MCPcopy Index your code
hub / github.com/pingdotgg/t3code / syncActivePreviewThread

Function syncActivePreviewThread

apps/web/src/previewStateStore.ts:83–92  ·  view source on GitHub ↗
(threadKey: string, state: ThreadPreviewState)

Source from the content-addressed store, hash-verified

81const changedPreviewThreadKeys = new Set<string>();
82
83function syncActivePreviewThread(threadKey: string, state: ThreadPreviewState): void {
84 const active = Object.keys(state.sessions).length > 0;
85 appAtomRegistry.update(activePreviewThreadKeysAtom, (current) => {
86 if (current.keys.has(threadKey) === active) return current;
87 const next = new Set(current.keys);
88 if (active) next.add(threadKey);
89 else next.delete(threadKey);
90 return { keys: next };
91 });
92}
93
94function updateThreadPreviewState(
95 ref: ScopedThreadRef,

Callers 2

updateThreadPreviewStateFunction · 0.85
removePreviewThreadFunction · 0.85

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected