The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 06:45 UTC
perf(web): the archived threads hook compiles without manual memoization (#20624)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:59 UTC
e36d0b2d1f3c7eee763ab566accf50fc601d5234
1 file changed
+3
-7
apps/web/src/lib/archivedThreadsState.ts
+3
-7
@@ -5,7 +5,6 @@ import {
5
makeArchivedThreadsEnvironmentKey,
6
} from "@t3tools/client-runtime/state/threads";
7
import type { EnvironmentId } from "@t3tools/contracts";
8
-import { useCallback, useMemo } from "react";
8
9
import { orchestrationEnvironment } from "../state/orchestration";
10
import { appAtomRegistry } from "../rpc/atomRegistry";
@@ -32,16 +31,13 @@ export function useArchivedThreadSnapshots(environmentIds: ReadonlyArray<Environ
31
readonly isLoading: boolean;
32
readonly refresh: () => void;
33
} {
35
- const environmentKey = useMemo(
36
- () => makeArchivedThreadsEnvironmentKey(environmentIds),
37
- [environmentIds],
38
- );
34
+ const environmentKey = makeArchivedThreadsEnvironmentKey(environmentIds);
35
const result = useAtomValue(archivedSnapshotsAtom(environmentKey));
40
- const refresh = useCallback(() => {
36
+ const refresh = () => {
37
for (const environmentId of environmentIds) {
38
appAtomRegistry.refresh(archivedSnapshotAtom(environmentId));
39
}
44
- }, [environmentIds]);
40
+ };
41
42
return {
43
...result,