mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-12-06 19:56:45 +10:30
fix: stop global search running when it is off
This commit is contained in:
2 files changed
+1
-35
No files matched your search
@@ -7,27 +7,8 @@ function crossedUpgrade(previousVersion: string, boundary: string): boolean {
|
||||
return prev != null && curr != null && !semver.lt(curr, boundary) && semver.lt(prev, boundary);
|
||||
}
|
||||
|
||||
/** One-time storage patches when crossing 3.6.5 / 3.6.6 / 3.7.0 / 3.7.7 (see git history on main). */
|
||||
/** One-time storage patches when crossing 3.6.6 / 3.7.0 / 3.7.7 (see git history on main). */
|
||||
export async function runStorageMigrations(previousVersion: string): Promise<void> {
|
||||
if (crossedUpgrade(previousVersion, "3.6.5")) {
|
||||
try {
|
||||
const key = "plugin.global-search.settings";
|
||||
const got = await browser.storage.local.get(key);
|
||||
const existing = (got[key] ?? {}) as Record<string, unknown>;
|
||||
await browser.storage.local.set({
|
||||
[key]: {
|
||||
...existing,
|
||||
enabled: true,
|
||||
transparencyEffects: true,
|
||||
runIndexingOnLoad: true,
|
||||
passiveIndexing: true,
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn("[BetterSEQTA+] Global Search 3.6.5 settings migration failed:", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (crossedUpgrade(previousVersion, "3.6.6")) {
|
||||
try {
|
||||
await browser.storage.local.set({ themeOfTheMonthDisabled: false });
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import browser from "@/lib/browser";
|
||||
import { settingsState } from "@/seqta/utils/listeners/settingsState";
|
||||
import { removeAnimatedBackgroundLayers } from "@/plugins/built-in/animatedBackground/backgroundLayers";
|
||||
import { applySidebarLook } from "@/seqta/ui/sidebar/sidebarStyles";
|
||||
@@ -101,20 +100,6 @@ async function syncPerformanceModePlugins(): Promise<void> {
|
||||
if (isPerformanceMode()) {
|
||||
removeAnimatedBackgroundLayers();
|
||||
window.dispatchEvent(new CustomEvent("betterseqta-background-music-stop"));
|
||||
} else {
|
||||
const searchSettings = await browser.storage.local.get("plugin.global-search.settings");
|
||||
const gs = searchSettings["plugin.global-search.settings"] as
|
||||
| { runIndexingOnLoad?: boolean }
|
||||
| undefined;
|
||||
if (gs?.runIndexingOnLoad && isPluginAllowedInPerformanceMode("global-search")) {
|
||||
const { runIndexing } =
|
||||
await import("@/plugins/built-in/globalSearch/src/indexing/indexer");
|
||||
if (typeof requestIdleCallback === "function") {
|
||||
requestIdleCallback(() => void runIndexing(), { timeout: 5000 });
|
||||
} else {
|
||||
setTimeout(() => void runIndexing(), 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("[BetterSEQTA+] Performance mode plugin sync failed:", error);
|
||||
|
||||
Reference in new issue
Block a user