Skip to content

Commit 26ef325

Browse files
gtryusGreg Trihus
andauthored
TT-6985 Refactor ProjectsScreen to simplify admin workflow modification logic (#164)
* TT-6985 Refactor ProjectsScreen to simplify admin workflow modification logic This update modifies the logic for determining if a user can modify the workflow in the ProjectsScreen component. The check for personal team status has been removed, streamlining the conditions under which workflow modifications are allowed. This change enhances code clarity and maintains the intended functionality. Key Changes: - Removed the isPersonal check from the canModifyWorkflow logic - Updated dependencies in the useMemo hook accordingly * remove misleading comment --------- Co-authored-by: Greg Trihus <[email protected]>
1 parent a80f07e commit 26ef325

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/renderer/src/routes/ProjectsScreen.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,13 @@ const ProjectsScreenInner: React.FC = () => {
192192
// eslint-disable-next-line react-hooks/exhaustive-deps
193193
}, [plan, pathname, home]);
194194

195-
// Admin gating (matches TeamItem logic): only show when viewing a team (not personal)
196195
const canModifyWorkflow = React.useMemo(() => {
197-
if (!thisTeam || isPersonal) return false;
196+
if (!thisTeam) return false;
198197
return (
199198
((!offline && isAdmin(thisTeam)) || offlineOnly) &&
200199
userIsOrgAdmin(thisTeam.id)
201200
);
202-
}, [thisTeam, isPersonal, offline, offlineOnly, isAdmin, userIsOrgAdmin]);
201+
}, [thisTeam, offline, offlineOnly, isAdmin, userIsOrgAdmin]);
203202

204203
return (
205204
<Box sx={{ width: '100%' }}>

0 commit comments

Comments
 (0)