mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
fix: don't highlight inactive org in management settings sidebar (#14059)
This commit is contained in:
@@ -15,11 +15,15 @@ import { useOrganizationSettings } from "./ManagementSettingsLayout";
|
||||
|
||||
export const Sidebar: FC = () => {
|
||||
const { organizations } = useOrganizationSettings();
|
||||
const { organization = getOrganizationNameByDefault(organizations) } =
|
||||
useParams() as { organization: string };
|
||||
const { organization } = useParams() as { organization?: string };
|
||||
const { multiple_organizations: organizationsEnabled } =
|
||||
useFeatureVisibility();
|
||||
|
||||
let organizationName = organization;
|
||||
if (location.pathname === "/organizations") {
|
||||
organizationName = getOrganizationNameByDefault(organizations);
|
||||
}
|
||||
|
||||
// TODO: Do something nice to scroll to the active org.
|
||||
|
||||
return (
|
||||
@@ -44,7 +48,7 @@ export const Sidebar: FC = () => {
|
||||
<OrganizationSettingsNavigation
|
||||
key={org.id}
|
||||
organization={org}
|
||||
active={org.name === organization}
|
||||
active={org.name === organizationName}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user