From c4346df24e29a4aff432b92601313a2cadaefc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Dub=C3=A9?= <7225168+KernelDeimos@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:22:06 -0500 Subject: [PATCH] fix(gui): defer login event until listener registered (#2547) Fixes an error introduced in 4b8c46e where the page load is attempted to be triggered by dispatching the login event, however the listener which handles loading the page has not yet been registered. --- src/gui/src/initgui.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index a6c6d7be0..f118941bb 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -1077,7 +1077,7 @@ window.initgui = async function (options) { }); } if ( !reload_on_success && window.is_auth() ) { - document.dispatchEvent(new Event('login', { bubbles: true })); + window.__login_completed = true; } } @@ -1577,6 +1577,11 @@ window.initgui = async function (options) { }); + if ( window.__login_completed ) { + document.dispatchEvent(new Event('login', { bubbles: true })); + window.__login_completed = false; + } + $('.popover, .context-menu').on('remove', function () { $('.window-active .window-app-iframe').css('pointer-events', 'all'); });