mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-08-28 17:21:05 +00:00
show TOTM popup until dismissed - forgotten commit
i forgot to commit this basically just shows until dismissed even persistent over reloads so the user doesn't lose it the moment they navigate away or if they load the page and close it immediately
This commit is contained in:
@@ -586,6 +586,41 @@ async function resetThemeOfTheMonthDisabledFor366Upgrade(
|
||||
}
|
||||
}
|
||||
|
||||
/** 3.7.0: Close no longer marks entries seen — clear legacy dismissal keys. */
|
||||
const THEME_OF_THE_MONTH_RELOAD_VERSION = "3.7.0";
|
||||
|
||||
async function resetThemeOfTheMonthDismissalFor370Upgrade(
|
||||
previousVersion: string,
|
||||
): Promise<void> {
|
||||
try {
|
||||
const currRaw = browser.runtime.getManifest().version;
|
||||
const prev = semver.coerce(previousVersion);
|
||||
const curr = semver.coerce(currRaw);
|
||||
if (
|
||||
prev == null ||
|
||||
curr == null ||
|
||||
semver.lt(curr, THEME_OF_THE_MONTH_RELOAD_VERSION) ||
|
||||
!semver.lt(prev, THEME_OF_THE_MONTH_RELOAD_VERSION)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
await browser.storage.local.set({
|
||||
themeOfTheMonthLastSeenId: undefined,
|
||||
themeOfTheMonthDismissedMonth: undefined,
|
||||
});
|
||||
|
||||
console.info(
|
||||
`[BetterSEQTA+] Migration ${THEME_OF_THE_MONTH_RELOAD_VERSION}: Theme of the Month shows again until dismissed for the month (from ${previousVersion}).`,
|
||||
);
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
"[BetterSEQTA+] Theme of the Month 3.7.0 dismissal migration failed:",
|
||||
e,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
browser.runtime.onInstalled.addListener(function (event) {
|
||||
browser.storage.local.remove(["justupdated"]);
|
||||
browser.storage.local.remove(["data"]);
|
||||
@@ -597,6 +632,7 @@ browser.runtime.onInstalled.addListener(function (event) {
|
||||
if (event.reason === "update" && event.previousVersion) {
|
||||
void migrateGlobalSearchDefaultsFor365Upgrade(event.previousVersion);
|
||||
void resetThemeOfTheMonthDisabledFor366Upgrade(event.previousVersion);
|
||||
void resetThemeOfTheMonthDismissalFor370Upgrade(event.previousVersion);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user