Skip to content

Commit 3f4333c

Browse files
refactor(web): remove unused preview thread reset helper
1 parent eced382 commit 3f4333c

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

‎apps/web/src/previewStateStore.test.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
readThreadPreviewState,
1919
reconcilePreviewServerSessions,
2020
rememberPreviewUrl,
21-
removePreviewThread,
2221
resetPreviewStateForTests,
2322
subscribeThreadPreviewState,
2423
setActivePreviewTab,
@@ -609,12 +608,4 @@ describe("previewStateStore (single-tab)", () => {
609608
`http://localhost:${5000 + __testing.RECENT_URL_LIMIT + 4}/`,
610609
);
611610
});
612-
613-
it("removeThread strips the entry", () => {
614-
const snapshot = makeSnapshot();
615-
applyPreviewServerSnapshot(ref, snapshot);
616-
removePreviewThread(ref);
617-
const state = readThreadPreviewState(ref);
618-
expect(state).toEqual(__testing.EMPTY_THREAD_PREVIEW_STATE);
619-
});
620611
});

‎apps/web/src/previewStateStore.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,6 @@ export function rememberPreviewUrl(ref: ScopedThreadRef, url: string): void {
472472
}));
473473
}
474474

475-
export function removePreviewThread(ref: ScopedThreadRef): void {
476-
const threadKey = scopedThreadKey(ref);
477-
appAtomRegistry.set(previewStateAtom(threadKey), EMPTY_THREAD_PREVIEW_STATE);
478-
syncActivePreviewThread(threadKey, EMPTY_THREAD_PREVIEW_STATE);
479-
changedPreviewThreadKeys.delete(threadKey);
480-
}
481-
482475
export function isPreviewSupportedInRuntime(): boolean {
483476
if (typeof window === "undefined") return false;
484477
return Boolean(window.desktopBridge?.preview);

0 commit comments

Comments
 (0)