mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
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.
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user