mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix: ensure the theme store triggers the cloud sync upon install
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
|||||||
initCloudSettingsAutoSync,
|
initCloudSettingsAutoSync,
|
||||||
performCloudSettingsDownloadWithRetry,
|
performCloudSettingsDownloadWithRetry,
|
||||||
performCloudSettingsUploadWithRetry,
|
performCloudSettingsUploadWithRetry,
|
||||||
|
requestCloudSettingsDebouncedUpload,
|
||||||
runCloudSettingsPoll,
|
runCloudSettingsPoll,
|
||||||
} from "./background/cloudSettingsAutoSync";
|
} from "./background/cloudSettingsAutoSync";
|
||||||
|
|
||||||
@@ -346,6 +347,10 @@ const MESSAGE_HANDLERS: Record<string, MessageHandler> = {
|
|||||||
void runCloudSettingsPoll();
|
void runCloudSettingsPoll();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
cloudSettingsRequestDebouncedUpload: () => {
|
||||||
|
requestCloudSettingsDebouncedUpload();
|
||||||
|
return false;
|
||||||
|
},
|
||||||
getSeqtaSession: (req: { baseUrl?: string }, sendResponse: MessageSender, sender?: browser.Runtime.MessageSender) => {
|
getSeqtaSession: (req: { baseUrl?: string }, sendResponse: MessageSender, sender?: browser.Runtime.MessageSender) => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -362,6 +362,17 @@ function scheduleDebouncedUpload(): void {
|
|||||||
}, UPLOAD_DEBOUNCE_MS);
|
}, 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> {
|
async function runDebouncedUploadJob(): Promise<void> {
|
||||||
const all = (await browser.storage.local.get()) as Record<string, unknown>;
|
const all = (await browser.storage.local.get()) as Record<string, unknown>;
|
||||||
if (!isAutoCloudSyncEnabled(all)) return;
|
if (!isAutoCloudSyncEnabled(all)) return;
|
||||||
|
|||||||
@@ -201,6 +201,7 @@
|
|||||||
await themeManager.setTheme(displayTheme.id);
|
await themeManager.setTheme(displayTheme.id);
|
||||||
themeUpdates.triggerUpdate();
|
themeUpdates.triggerUpdate();
|
||||||
await fetchCurrentThemes();
|
await fetchCurrentThemes();
|
||||||
|
void browser.runtime.sendMessage({ type: 'cloudSettingsRequestDebouncedUpload' }).catch(() => {});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onRemove={async () => {
|
onRemove={async () => {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export function OpenWhatsNewPopup(onDismissed?: () => void) {
|
|||||||
<h1>3.6.4 - Fix for alpine theme & Assement dashlet improvement</h1>
|
<h1>3.6.4 - Fix for alpine theme & Assement dashlet improvement</h1>
|
||||||
<li>Added advanced colour adjustments variables for theme customisation.</li>
|
<li>Added advanced colour adjustments variables for theme customisation.</li>
|
||||||
<li>Improved logic for assement dashlet to improve compatibility.</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>
|
<h1>3.6.3 - Assessment overview fix</h1>
|
||||||
<li>Fixed assessments overview failing to load.</li>
|
<li>Fixed assessments overview failing to load.</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user