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 {...@@ -18,7 +18,6 @@ import {
18 readThreadPreviewState,18 readThreadPreviewState,
19 reconcilePreviewServerSessions,19 reconcilePreviewServerSessions,
20 rememberPreviewUrl,20 rememberPreviewUrl,
21 removePreviewThread,
22 resetPreviewStateForTests,21 resetPreviewStateForTests,
23 subscribeThreadPreviewState,22 subscribeThreadPreviewState,
24 setActivePreviewTab,23 setActivePreviewTab,
...@@ -609,12 +608,4 @@ describe("previewStateStore (single-tab)", () => {...@@ -609,12 +608,4 @@ describe("previewStateStore (single-tab)", () => {
609 `http://localhost:${5000 + __testing.RECENT_URL_LIMIT + 4}/`,608 `http://localhost:${5000 + __testing.RECENT_URL_LIMIT + 4}/`,
610 );609 );
611 });610 });
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 });
620});611});
apps/web/src/previewStateStore.ts-7
...@@ -472,13 +472,6 @@ export function rememberPreviewUrl(ref: ScopedThreadRef, url: string): void {...@@ -472,13 +472,6 @@ export function rememberPreviewUrl(ref: ScopedThreadRef, url: string): void {
472 }));472 }));
473}473}
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
482export function isPreviewSupportedInRuntime(): boolean {475export function isPreviewSupportedInRuntime(): boolean {
483 if (typeof window === "undefined") return false;476 if (typeof window === "undefined") return false;
484 return Boolean(window.desktopBridge?.preview);477 return Boolean(window.desktopBridge?.preview);