fix: add URL hash handling for tab navigation

This commit is contained in:
root
2026-02-26 22:15:54 +00:00
parent 2188298217
commit 7eef8aaff1
+20
View File
@@ -245,4 +245,24 @@ function switchTab(tabName) {
loadHomeContent(); loadHomeContent();
} }
} }
// Handle URL hash on page load
if (window.location.hash) {
const hash = window.location.hash.substring(1);
if (hash === 'watchlist' || hash === 'anime' || hash === 'series' || hash === 'providers') {
switchTab(hash);
}
}
}
// Listen for hash changes
window.addEventListener('hashchange', () => {
if (window.location.hash) {
const hash = window.location.hash.substring(1);
if (hash === 'watchlist' || hash === 'anime' || hash === 'series' || hash === 'providers') {
switchTab(hash);
}
}
});
}
} }