File tree 1 file changed +7
-3
lines changed
site/src/pages/ManagementSettingsPage
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,15 @@ import { useOrganizationSettings } from "./ManagementSettingsLayout";
15
15
16
16
export const Sidebar : FC = ( ) => {
17
17
const { organizations } = useOrganizationSettings ( ) ;
18
- const { organization = getOrganizationNameByDefault ( organizations ) } =
19
- useParams ( ) as { organization : string } ;
18
+ const { organization } = useParams ( ) as { organization ?: string } ;
20
19
const { multiple_organizations : organizationsEnabled } =
21
20
useFeatureVisibility ( ) ;
22
21
22
+ let organizationName = organization ;
23
+ if ( location . pathname === "/organizations" ) {
24
+ organizationName = getOrganizationNameByDefault ( organizations ) ;
25
+ }
26
+
23
27
// TODO: Do something nice to scroll to the active org.
24
28
25
29
return (
@@ -44,7 +48,7 @@ export const Sidebar: FC = () => {
44
48
< OrganizationSettingsNavigation
45
49
key = { org . id }
46
50
organization = { org }
47
- active = { org . name === organization }
51
+ active = { org . name === organizationName }
48
52
/>
49
53
) ) }
50
54
</ >
You can’t perform that action at this time.
0 commit comments