fix: ensure the theme store triggers the cloud sync upon install

This commit is contained in:
2026-04-29 10:25:41 +09:30
parent 1b87d20a27
commit b88d29967d
4 changed files with 18 additions and 0 deletions
+5
View File
@@ -5,6 +5,7 @@ import {
initCloudSettingsAutoSync,
performCloudSettingsDownloadWithRetry,
performCloudSettingsUploadWithRetry,
requestCloudSettingsDebouncedUpload,
runCloudSettingsPoll,
} from "./background/cloudSettingsAutoSync";
@@ -346,6 +347,10 @@ const MESSAGE_HANDLERS: Record<string, MessageHandler> = {
void runCloudSettingsPoll();
return false;
},
cloudSettingsRequestDebouncedUpload: () => {
requestCloudSettingsDebouncedUpload();
return false;
},
getSeqtaSession: (req: { baseUrl?: string }, sendResponse: MessageSender, sender?: browser.Runtime.MessageSender) => {
(async () => {
try {
+11
View File
@@ -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<string, unknown>;
if (!isAutoCloudSyncEnabled(all)) return;
if (suppressAutoUploadDuringRestore) return;
if (!(await getAccessToken())) return;
scheduleDebouncedUpload();
})();
}
async function runDebouncedUploadJob(): Promise<void> {
const all = (await browser.storage.local.get()) as Record<string, unknown>;
if (!isAutoCloudSyncEnabled(all)) return;
+1
View File
@@ -201,6 +201,7 @@
await themeManager.setTheme(displayTheme.id);
themeUpdates.triggerUpdate();
await fetchCurrentThemes();
void browser.runtime.sendMessage({ type: 'cloudSettingsRequestDebouncedUpload' }).catch(() => {});
}
}}
onRemove={async () => {
@@ -38,6 +38,7 @@ export function OpenWhatsNewPopup(onDismissed?: () => void) {
<h1>3.6.4 - Fix for alpine theme & Assement dashlet improvement</h1>
<li>Added advanced colour adjustments variables for theme customisation.</li>
<li>Improved logic for assement dashlet to improve compatibility.</li>
<li>BS Cloud can now automatically download themes from other devices.</li>
<h1>3.6.3 - Assessment overview fix</h1>
<li>Fixed assessments overview failing to load.</li>