authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:30:07-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:30:07-07:00
log91ba05e870603b6bc0649e33973f73d86cbf58c3
tree08ab21a90117479f6743a35f58363bc84b451492
parent62e74cdd9a0aa4df5fc612d94193da9610129dc9
signature Signed by PGP key B5690EEEBB952194

refactor(web): remove unused preview thread reset helper (#10049)


2 files changed, 0 insertions(+), 16 deletions(-)

apps/web/src/previewStateStore.test.ts-9
......@@ -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-7
......@@ -472,13 +472,6 @@ export function rememberPreviewUrl(ref: ScopedThreadRef, url: string): void {
472472 }));
473473}
474474
475export 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
482475export function isPreviewSupportedInRuntime(): boolean {
483476 if (typeof window === "undefined") return false;
484477 return Boolean(window.desktopBridge?.preview);