From b88d29967db1efe92bad57aefd9667ee7514525c Mon Sep 17 00:00:00 2001 From: Aden Linday Date: Wed, 29 Apr 2026 10:25:41 +0930 Subject: [PATCH] fix: ensure the theme store triggers the cloud sync upon install --- src/background.ts | 5 +++++ src/background/cloudSettingsAutoSync.ts | 11 +++++++++++ src/interface/pages/store.svelte | 1 + src/seqta/utils/Openers/OpenWhatsNewPopup.ts | 1 + 4 files changed, 18 insertions(+) diff --git a/src/background.ts b/src/background.ts index d0926ae7..32f22083 100644 --- a/src/background.ts +++ b/src/background.ts @@ -5,6 +5,7 @@ import { initCloudSettingsAutoSync, performCloudSettingsDownloadWithRetry, performCloudSettingsUploadWithRetry, + requestCloudSettingsDebouncedUpload, runCloudSettingsPoll, } from "./background/cloudSettingsAutoSync"; @@ -346,6 +347,10 @@ const MESSAGE_HANDLERS: Record = { void runCloudSettingsPoll(); return false; }, + cloudSettingsRequestDebouncedUpload: () => { + requestCloudSettingsDebouncedUpload(); + return false; + }, getSeqtaSession: (req: { baseUrl?: string }, sendResponse: MessageSender, sender?: browser.Runtime.MessageSender) => { (async () => { try { diff --git a/src/background/cloudSettingsAutoSync.ts b/src/background/cloudSettingsAutoSync.ts index 94218d1c..1ac8433f 100644 --- a/src/background/cloudSettingsAutoSync.ts +++ b/src/background/cloudSettingsAutoSync.ts @@ -362,6 +362,17 @@ function scheduleDebouncedUpload(): void { }, UPLOAD_DEBOUNCE_MS); } +/** Call after store theme install (and similar) so cloud upload runs even if storage events are flaky. */ +export function requestCloudSettingsDebouncedUpload(): void { + void (async () => { + const all = (await browser.storage.local.get()) as Record; + if (!isAutoCloudSyncEnabled(all)) return; + if (suppressAutoUploadDuringRestore) return; + if (!(await getAccessToken())) return; + scheduleDebouncedUpload(); + })(); +} + async function runDebouncedUploadJob(): Promise { const all = (await browser.storage.local.get()) as Record; if (!isAutoCloudSyncEnabled(all)) return; diff --git a/src/interface/pages/store.svelte b/src/interface/pages/store.svelte index d9689bd4..7b05711d 100644 --- a/src/interface/pages/store.svelte +++ b/src/interface/pages/store.svelte @@ -201,6 +201,7 @@ await themeManager.setTheme(displayTheme.id); themeUpdates.triggerUpdate(); await fetchCurrentThemes(); + void browser.runtime.sendMessage({ type: 'cloudSettingsRequestDebouncedUpload' }).catch(() => {}); } }} onRemove={async () => { diff --git a/src/seqta/utils/Openers/OpenWhatsNewPopup.ts b/src/seqta/utils/Openers/OpenWhatsNewPopup.ts index 2d43dc10..3fbd0aef 100644 --- a/src/seqta/utils/Openers/OpenWhatsNewPopup.ts +++ b/src/seqta/utils/Openers/OpenWhatsNewPopup.ts @@ -38,6 +38,7 @@ export function OpenWhatsNewPopup(onDismissed?: () => void) {

3.6.4 - Fix for alpine theme & Assement dashlet improvement

  • Added advanced colour adjustments variables for theme customisation.
  • Improved logic for assement dashlet to improve compatibility.
  • +
  • BS Cloud can now automatically download themes from other devices.
  • 3.6.3 - Assessment overview fix

  • Fixed assessments overview failing to load.