Don't save window stats after shutdown request
This commit is contained in:
parent
fc60a8b13d
commit
d8e32d39ff
2 changed files with 14 additions and 1 deletions
|
@ -774,7 +774,9 @@ async function createWindow() {
|
||||||
// so if we need to recreate the window, we have the most recent settings
|
// so if we need to recreate the window, we have the most recent settings
|
||||||
windowConfig = newWindowConfig;
|
windowConfig = newWindowConfig;
|
||||||
|
|
||||||
debouncedSaveStats();
|
if (!windowState.requestedShutdown()) {
|
||||||
|
debouncedSaveStats();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindow.on('resize', captureWindowStats);
|
mainWindow.on('resize', captureWindowStats);
|
||||||
|
@ -856,6 +858,7 @@ async function createWindow() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
windowState.markRequestedShutdown();
|
||||||
await requestShutdown();
|
await requestShutdown();
|
||||||
windowState.markReadyForShutdown();
|
windowState.markReadyForShutdown();
|
||||||
|
|
||||||
|
|
|
@ -20,3 +20,13 @@ export function markReadyForShutdown(): void {
|
||||||
export function readyForShutdown(): boolean {
|
export function readyForShutdown(): boolean {
|
||||||
return isReadyForShutdown;
|
return isReadyForShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let hasRequestedShutdown = false;
|
||||||
|
|
||||||
|
export function markRequestedShutdown(): void {
|
||||||
|
hasRequestedShutdown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function requestedShutdown(): boolean {
|
||||||
|
return hasRequestedShutdown;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue