Skip to content

Commit 7c1e859

Browse files
committed
fix: centralize org display name logic
1 parent 5e0689d commit 7c1e859

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/src/pages/WorkspacePage/WorkspaceTopbar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
116116
(org) => org.id === workspace.organization_id,
117117
);
118118

119+
const orgDisplayName = activeOrg?.display_name ?? workspace.organization_name;
120+
119121
const isImmutable =
120122
workspace.latest_build.status === "deleted" ||
121123
workspace.latest_build.status === "deleting";
@@ -143,7 +145,7 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
143145
<>
144146
<TopbarDivider />
145147
<OrganizationBreadcrumb
146-
orgName={activeOrg?.display_name ?? workspace.organization_name}
148+
orgName={orgDisplayName}
147149
orgIconUrl={activeOrg?.icon}
148150
orgPageUrl={
149151
showOrganizations
@@ -179,7 +181,7 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
179181
}
180182
title={
181183
showOrganizations
182-
? `See affected workspaces for ${workspace.organization_name}`
184+
? `See affected workspaces for ${orgDisplayName}`
183185
: "See affected workspaces"
184186
}
185187
>

0 commit comments

Comments
 (0)