mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Improve loading Discovery sections when infinite scroll is enabled, also remove MediaBar layout sync fix
This commit is contained in:
1 parent
9c9574f863
commit
b025c12972
2 files changed
+46
-21
No files matched your search
@@ -1592,9 +1592,15 @@
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
/** After an empty section is removed, let discovery infinite-scroll refill lead margin. */
|
||||
function notifyDiscoveryLeadFillAfterSectionRemove() {
|
||||
window.homeScreen3?.scheduleMaybeFillDiscoveryViewport?.();
|
||||
}
|
||||
|
||||
async function replaceSectionContent(sectionConfig, sectionElement, freshItems) {
|
||||
if (freshItems.length === 0) {
|
||||
sectionElement.remove();
|
||||
notifyDiscoveryLeadFillAfterSectionRemove();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2024,6 +2030,7 @@
|
||||
freshItems = await refreshSectionQueries(sectionConfig);
|
||||
if (freshItems.length === 0) {
|
||||
sectionElement.remove();
|
||||
notifyDiscoveryLeadFillAfterSectionRemove();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -10220,6 +10227,7 @@
|
||||
sectionElement.classList.add('is-hidden');
|
||||
runAfterTransition(sectionElement, 320, () => {
|
||||
sectionElement.remove();
|
||||
notifyDiscoveryLeadFillAfterSectionRemove();
|
||||
});
|
||||
}, hold);
|
||||
}
|
||||
@@ -10266,6 +10274,7 @@
|
||||
dismissEmptyProgressiveSection(sectionElement, { holdMs });
|
||||
} else {
|
||||
sectionElement.remove();
|
||||
notifyDiscoveryLeadFillAfterSectionRemove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user