Skip to content

Commit 085b27d

Browse files
committed
fix: don't highlight inactive org in management settings sidebar
1 parent cf1fcab commit 085b27d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

site/src/pages/ManagementSettingsPage/Sidebar.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ import { useOrganizationSettings } from "./ManagementSettingsLayout";
1515

1616
export const Sidebar: FC = () => {
1717
const { organizations } = useOrganizationSettings();
18-
const { organization = getOrganizationNameByDefault(organizations) } =
19-
useParams() as { organization: string };
18+
const { organization } = useParams() as { organization?: string };
2019
const { multiple_organizations: organizationsEnabled } =
2120
useFeatureVisibility();
2221

22+
let organizationName = organization;
23+
if (location.pathname === "/organizations") {
24+
organizationName = getOrganizationNameByDefault(organizations);
25+
}
26+
2327
// TODO: Do something nice to scroll to the active org.
2428

2529
return (
@@ -44,7 +48,7 @@ export const Sidebar: FC = () => {
4448
<OrganizationSettingsNavigation
4549
key={org.id}
4650
organization={org}
47-
active={org.name === organization}
51+
active={org.name === organizationName}
4852
/>
4953
))}
5054
</>

0 commit comments

Comments
 (0)