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
+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;