From 5991f39c4f672c89d91754071bc670787577ede3 Mon Sep 17 00:00:00 2001 From: Stardream Date: Fri, 22 May 2026 22:03:35 +1000 Subject: [PATCH] fix: local push view not initializing when navigating from login page - 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 --- public/admin.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/admin.html b/public/admin.html index 5adea75..af239bf 100644 --- a/public/admin.html +++ b/public/admin.html @@ -2825,6 +2825,7 @@ loadStreams(); const view = (location.hash || '').replace(/^#/, '') || localStorage.getItem('admin_active_view') || '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 => { @@ -5538,6 +5539,7 @@ document.addEventListener('DOMContentLoaded', () => { document.querySelector('[data-admin-view-target="local"]') ?.addEventListener('click', openPushView); + document.addEventListener('admin:enter-local', openPushView); document.querySelectorAll('.admin-menu-btn:not([data-admin-view-target="local"]), .admin-sub-btn') .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(); }); })();