Skip to content

Commit 7b59c0f

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

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎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)