Improve support for Client Cache query types

This commit is contained in:
HighImKevin committed 2026-10-01 06:48:17 -04:00
1 parent 7abf79bbe5
commit 3229ba4123
6 files changed
+295 -99

No files matched your search

+10 -20
View File
@@ -316,6 +316,7 @@
});
}
/** Defer crawl until idle/hidden/fallback after home has a chance to paint. */
let bootstrapStarted = false;
let bootstrapScheduled = false;
@@ -333,26 +334,15 @@
function scheduleBootstrap() {
if (bootstrapScheduled) return;
bootstrapScheduled = true;
const start = () => { bootstrap(); };
const onPainted = () => {
document.removeEventListener('kefinTweaksHomePainted', onPainted);
start();
};
document.addEventListener('kefinTweaksHomePainted', onPainted);
waitForLoginReady().then((ok) => {
if (!ok) {
document.removeEventListener('kefinTweaksHomePainted', onPainted);
start();
return;
}
setTimeout(() => {
document.removeEventListener('kefinTweaksHomePainted', onPainted);
start();
}, 3000);
});
const utils = window.LibraryCacheUtils;
if (utils?.scheduleIdleBootstrap) {
utils.scheduleIdleBootstrap({
waitForLogin: waitForLoginReady,
onReady: () => { bootstrap(); }
});
return;
}
waitForLoginReady().then(() => bootstrap());
}
window.SeriesCache = {