From dfcafae2b1c9ba92a4a0f700c2c0d554a1cf2299 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Thu, 8 May 2025 09:05:53 +0300 Subject: [PATCH] fix: options page crush on cloud storage disabling --- entrypoints/background.ts | 1 + features/collectionStorage/utils/setCloudStorage.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoints/background.ts b/entrypoints/background.ts index 7884e5c..405cc33 100644 --- a/entrypoints/background.ts +++ b/entrypoints/background.ts @@ -68,6 +68,7 @@ export default defineBackground(() => icon: graphicsCache[data.url]?.icon }; }); + onMessage("refreshCollections", () => {}); setupTabCaputre(); async function setupTabCaputre(): Promise diff --git a/features/collectionStorage/utils/setCloudStorage.ts b/features/collectionStorage/utils/setCloudStorage.ts index bd392c8..e902c93 100644 --- a/features/collectionStorage/utils/setCloudStorage.ts +++ b/features/collectionStorage/utils/setCloudStorage.ts @@ -1,3 +1,4 @@ +import { sendMessage } from "@/utils/messaging"; import { collectionStorage } from "./collectionStorage"; import saveCollectionsToCloud from "./saveCollectionsToCloud"; @@ -14,6 +15,6 @@ export default async function setCloudStorage(enable: boolean): Promise { await collectionStorage.disableCloud.setValue(true); await saveCollectionsToCloud([], 0); - browser.runtime.reload(); + await sendMessage("refreshCollections", undefined); } }