Skip to content

Commit 00bf222

Browse files
perf(web): settings project groups compile without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 00bf222

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { useMemo } from "react";
2-
31
import { useClientSettings } from "../../hooks/useSettings";
42
import { selectProjectGroupingSettings } from "../../logicalProject";
53
import { buildSidebarProjectSnapshots } from "../../sidebarProjectGrouping";
@@ -11,13 +9,11 @@ export function useSettingsProjectGroups() {
119
const settings = useClientSettings(selectProjectGroupingSettings);
1210
const primaryEnvironmentId = usePrimaryEnvironmentId();
1311
const { environments } = useEnvironments();
14-
return useMemo(() => {
15-
const labels = new Map(environments.map((entry) => [entry.environmentId, entry.label]));
16-
return buildSidebarProjectSnapshots({
17-
projects,
18-
settings,
19-
primaryEnvironmentId,
20-
resolveEnvironmentLabel: (id) => labels.get(id) ?? null,
21-
}).sort((a, b) => a.displayName.localeCompare(b.displayName));
22-
}, [environments, primaryEnvironmentId, projects, settings]);
12+
const labels = new Map(environments.map((entry) => [entry.environmentId, entry.label]));
13+
return buildSidebarProjectSnapshots({
14+
projects,
15+
settings,
16+
primaryEnvironmentId,
17+
resolveEnvironmentLabel: (id) => labels.get(id) ?? null,
18+
}).sort((a, b) => a.displayName.localeCompare(b.displayName));
2319
}

0 commit comments

Comments
 (0)