fix: local push view not initializing when navigating from login page
Build and Push Docker Image / build (push) Successful in 11s

- enterPanel() now dispatches admin:enter-local when the active view is local,
  matching the existing admin:enter-dashboard pattern
- DOMContentLoaded block listens for admin:enter-local to call openPushView()
- Initial hash check also falls back to localStorage so a page refresh with
  local view stored also triggers file browser load
This commit is contained in:
Stardream
2026-05-22 22:03:35 +10:00
parent 38cd9dbeaf
commit 5991f39c4f
+3 -1
View File
@@ -2825,6 +2825,7 @@
loadStreams(); loadStreams();
const view = (location.hash || '').replace(/^#/, '') || localStorage.getItem('admin_active_view') || 'dashboard'; const view = (location.hash || '').replace(/^#/, '') || localStorage.getItem('admin_active_view') || 'dashboard';
if (view === 'dashboard') document.dispatchEvent(new CustomEvent('admin:enter-dashboard')); if (view === 'dashboard') document.dispatchEvent(new CustomEvent('admin:enter-dashboard'));
if (view === 'local') document.dispatchEvent(new CustomEvent('admin:enter-local'));
}; };
apiCall('session').then(res => { apiCall('session').then(res => {
@@ -5538,6 +5539,7 @@
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
document.querySelector('[data-admin-view-target="local"]') document.querySelector('[data-admin-view-target="local"]')
?.addEventListener('click', openPushView); ?.addEventListener('click', openPushView);
document.addEventListener('admin:enter-local', openPushView);
document.querySelectorAll('.admin-menu-btn:not([data-admin-view-target="local"]), .admin-sub-btn') document.querySelectorAll('.admin-menu-btn:not([data-admin-view-target="local"]), .admin-sub-btn')
.forEach(btn => btn.addEventListener('click', stopJobPolling)); .forEach(btn => btn.addEventListener('click', stopJobPolling));
@@ -5729,7 +5731,7 @@
}); });
}); });
if ((location.hash || '').replace(/^#/, '') === 'local') openPushView(); if (((location.hash || '').replace(/^#/, '') || localStorage.getItem('admin_active_view')) === 'local') openPushView();
}); });
})(); })();
</script> </script>