fix: settings race condition and URL deep linking

This commit is contained in:
Trevor Mears
2026-01-17 18:32:19 -08:00
parent 26ccafa3ec
commit 95591a0c84
2 changed files with 29 additions and 21 deletions
+6 -2
View File
@@ -137,9 +137,13 @@ class App {
this.navigateTo(page, false); // false = don't add to history
});
// Initialize home page
// Initialize home page first (it's needed for channel list)
await this.pages.home.init();
this.navigateTo('home', true); // true = replace history (don't add)
// Navigate to the page from URL hash, or default to home
const hash = window.location.hash.slice(1); // Remove #
const initialPage = hash && this.pages[hash] ? hash : 'home';
this.navigateTo(initialPage, true); // true = replace history (don't add)
console.log('NodeCast TV initialized');
}