refactor(web): remove unused preview thread reset helper (#10049)
This commit is contained in:
1 parent
62e74cdd9a
commit
91ba05e870
2 files changed
-16
No files matched your search
@@ -18,7 +18,6 @@ import {
|
||||
readThreadPreviewState,
|
||||
reconcilePreviewServerSessions,
|
||||
rememberPreviewUrl,
|
||||
removePreviewThread,
|
||||
resetPreviewStateForTests,
|
||||
subscribeThreadPreviewState,
|
||||
setActivePreviewTab,
|
||||
@@ -609,12 +608,4 @@ describe("previewStateStore (single-tab)", () => {
|
||||
`http://localhost:${5000 + __testing.RECENT_URL_LIMIT + 4}/`,
|
||||
);
|
||||
});
|
||||
|
||||
it("removeThread strips the entry", () => {
|
||||
const snapshot = makeSnapshot();
|
||||
applyPreviewServerSnapshot(ref, snapshot);
|
||||
removePreviewThread(ref);
|
||||
const state = readThreadPreviewState(ref);
|
||||
expect(state).toEqual(__testing.EMPTY_THREAD_PREVIEW_STATE);
|
||||
});
|
||||
});
|
||||
@@ -472,13 +472,6 @@ export function rememberPreviewUrl(ref: ScopedThreadRef, url: string): void {
|
||||
}));
|
||||
}
|
||||
|
||||
export function removePreviewThread(ref: ScopedThreadRef): void {
|
||||
const threadKey = scopedThreadKey(ref);
|
||||
appAtomRegistry.set(previewStateAtom(threadKey), EMPTY_THREAD_PREVIEW_STATE);
|
||||
syncActivePreviewThread(threadKey, EMPTY_THREAD_PREVIEW_STATE);
|
||||
changedPreviewThreadKeys.delete(threadKey);
|
||||
}
|
||||
|
||||
export function isPreviewSupportedInRuntime(): boolean {
|
||||
if (typeof window === "undefined") return false;
|
||||
return Boolean(window.desktopBridge?.preview);
|
||||
|
||||
Reference in new issue
Block a user