Skip to content

Commit 119760d

Browse files
perf(web): the browser favicon store compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7111501 commit 119760d

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/browserFaviconStore.ts",
99100
] as const;

‎apps/web/src/browserFaviconStore.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
} from "@t3tools/client-runtime/environment";
66
import type { DesktopPreviewFavicon, ScopedProjectRef, ScopedThreadRef } from "@t3tools/contracts";
77
import * as Option from "effect/Option";
8-
import { useMemo } from "react";
98
import { create } from "zustand";
109
import { createJSONStorage, persist } from "zustand/middleware";
1110

@@ -199,10 +198,8 @@ export function registerFaviconProjectForThread(
199198
export function useFaviconProjectRefForThread(threadRef: ScopedThreadRef): ScopedProjectRef | null {
200199
const shell = useThreadShell(threadRef);
201200
const shellProjectId = shell?.projectId ?? null;
202-
const shellProjectRef = useMemo(
203-
() => (shellProjectId ? scopeProjectRef(threadRef.environmentId, shellProjectId) : null),
204-
[shellProjectId, threadRef.environmentId],
205-
);
201+
const environmentId = threadRef.environmentId;
202+
const shellProjectRef = shellProjectId ? scopeProjectRef(environmentId, shellProjectId) : null;
206203
const registered = useBrowserFaviconStore(
207204
(state) => state.projectRefByThreadKey[scopedThreadKey(threadRef)] ?? null,
208205
);

0 commit comments

Comments
 (0)