fix: add URL hash handling for tab navigation
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user