mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix Home Screen infinite loading attempting to render sections when not on home page
This commit is contained in:
1 parent
2ca9a3f3a5
commit
ba6cb2380a
1 file changed
+16
-1
+16
-1
@@ -2337,7 +2337,7 @@
|
||||
* Sets up scroll-based infinite loading
|
||||
* @param {HTMLElement} container - Container to watch for scroll
|
||||
*/
|
||||
function setupScrollBasedLoading(container) {
|
||||
function setupScrollBasedLoading(container) {
|
||||
// Remove existing handler if present (make idempotent)
|
||||
removeScrollBasedLoading();
|
||||
|
||||
@@ -2345,6 +2345,21 @@
|
||||
let scrollTimeout = null;
|
||||
|
||||
const handleScroll = () => {
|
||||
// Ensure we're on the home page before proceeding
|
||||
const currentView = window.KefinTweaksUtils?.getCurrentView();
|
||||
const isHomePage = currentView === 'home' || currentView === 'home.html';
|
||||
|
||||
if (!isHomePage) {
|
||||
LOG('Not on home page, skipping scroll-based loading setup');
|
||||
return;
|
||||
}
|
||||
|
||||
const activeTab = document.querySelector('.headerTabs .emby-tab-button-active').getAttribute('data-index');
|
||||
if (activeTab !== '0') {
|
||||
LOG('Not on home page, skipping scroll-based loading setup');
|
||||
return;
|
||||
}
|
||||
|
||||
if (isRenderingDiscoveryGroup) return;
|
||||
|
||||
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
|
||||
Reference in new issue
Block a user