From 48d9a16eec08d96d69b36f1277181d150750f2c1 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Fri, 2 Sep 2022 19:42:08 +0530 Subject: [PATCH] use quit role ,and move setIsAppQuitting logic to app.on("before-quit") --- src/main.ts | 2 ++ src/utils/menu.ts | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 238bd90a0..f54ddd042 100644 --- a/src/main.ts +++ b/src/main.ts @@ -74,4 +74,6 @@ if (!gotTheLock) { handleDownloads(mainWindow); addAllowOriginHeader(mainWindow); }); + + app.on('before-quit', () => setIsAppQuitting(true)); } diff --git a/src/utils/menu.ts b/src/utils/menu.ts index a1c58df8d..f17aff618 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -121,11 +121,7 @@ export function buildMenuBar(): Menu { { type: 'separator' }, { label: 'Quit ente', - accelerator: 'CommandOrControl+Q', - click() { - setIsAppQuitting(true); - app.quit(); - }, + role: 'quit', }, ], },