mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Improve support for Client Cache query types
This commit is contained in:
1 parent
7abf79bbe5
commit
3229ba4123
6 files changed
+295
-99
No files matched your search
+10
-20
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user