Skip to content

Commit 9af76c0

Browse files
committed
Only show create team button if user has no orgs
1 parent 8cf4ac0 commit 9af76c0

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

webview-ui/src/components/cloud/CloudAccountSwitcher.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,18 @@ export const CloudAccountSwitcher = () => {
149149
</SelectItem>
150150
))}
151151

152-
{/* Add separator before Create Team Account option */}
153-
<SelectSeparator />
154-
155-
{/* Create Team Account Option */}
156-
<SelectItem value="create-team">
157-
<div className="flex items-center gap-2">
158-
<Plus className="w-4.5 h-4.5" />
159-
<span>{t("cloud:createTeamAccount")}</span>
160-
</div>
161-
</SelectItem>
152+
{/* Only show Create Team Account if user has no organizations */}
153+
{cloudOrganizations.length === 0 && (
154+
<>
155+
<SelectSeparator />
156+
<SelectItem value="create-team">
157+
<div className="flex items-center gap-2">
158+
<Plus className="w-4.5 h-4.5" />
159+
<span>{t("cloud:createTeamAccount")}</span>
160+
</div>
161+
</SelectItem>
162+
</>
163+
)}
162164
</SelectContent>
163165
</Select>
164166
</div>

webview-ui/src/components/cloud/OrganizationSwitcher.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,18 @@ export const OrganizationSwitcher = ({
152152
</SelectItem>
153153
))}
154154

155-
{/* Add separator before Create Team Account option */}
156-
<SelectSeparator />
157-
158-
{/* Create Team Account Option */}
159-
<SelectItem value="create-team">
160-
<div className="flex items-center gap-2">
161-
<Plus className="w-4.5 h-4.5" />
162-
<span>{t("cloud:createTeamAccount")}</span>
163-
</div>
164-
</SelectItem>
155+
{/* Only show Create Team Account if user has no organizations */}
156+
{organizations.length === 0 && (
157+
<>
158+
<SelectSeparator />
159+
<SelectItem value="create-team">
160+
<div className="flex items-center gap-2">
161+
<Plus className="w-4.5 h-4.5" />
162+
<span>{t("cloud:createTeamAccount")}</span>
163+
</div>
164+
</SelectItem>
165+
</>
166+
)}
165167
</SelectContent>
166168
</Select>
167169
</div>

0 commit comments

Comments
 (0)