mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-28 02:21:30 +02:00
The trigger-login event only has a listener in the main window's React app, so with lazily created windows every tray-driven login flow (Connect click, SSO auto-handoff, post-profile-switch login, session-extend dialog) silently died when the main window did not exist. The WindowManager now watches the event itself: if no ready main window is live it builds one hidden, queues a re-emit until the frontend has subscribed, and never shows it. Once the flow settles (Connected, LoginFailed, DaemonUnavailable, or the popup is cancelled) the headless window is closed after a short grace period, so the idle-memory win of lazy windows is kept. A window the user shows meanwhile is never torn down, and a new trigger cancels a pending teardown.