Files
iptvnator/libs/shared/interfaces
4grayandClaude Fable 5 3f9348584a fix(settings): protect unsaved edits on window close, quit, and reload
The settingsUnsavedChangesGuard only covers router navigation; closing
the Electron window, quitting the app, or reloading the page silently
dropped staged settings edits.

Renderer: SettingsUnloadGuardService (provided by SettingsComponent)
arms a beforeunload handler while the form is dirty — native leave
prompt in the PWA, cancelled-and-redialogued reload in Electron — and
mirrors the dirty state to the main process.

Main process: WindowCloseGuard intercepts BrowserWindow close before
beforeunload fires, pushes WINDOW:CLOSE_REQUESTED to the renderer for
the same save/discard/stay dialog, and replays the original intent
(close vs. quit, tracked via before-quit) only after the renderer
confirms. A failed save never confirms, keeping the guard's semantics.
The guard disarms on renderer navigation, crash, or destroyed
webContents so a window can never become unclosable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 10:51:44 +02:00
..