From 7f13f380e154d881c32997cdc7948c1fa5697dce Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Mon, 13 Sep 2021 04:29:02 +0530 Subject: revert: partially revert fix for #1879 since the system tray doesn't behave correctly. (#1918) --- src/lib/Tray.js | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/lib/Tray.js') diff --git a/src/lib/Tray.js b/src/lib/Tray.js index c897d597a..f5970f7e7 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js @@ -1,5 +1,5 @@ import { - app, Menu, nativeImage, nativeTheme, systemPreferences, Tray, ipcMain, dialog, + app, Menu, nativeImage, nativeTheme, systemPreferences, Tray, ipcMain, } from 'electron'; import { join } from 'path'; import macosVersion from 'macos-version'; @@ -43,7 +43,9 @@ export default class TrayIcon { }, { label: 'Quit Ferdi', - click: this.quitApp, + click() { + app.quit(); + }, }, ]; @@ -176,22 +178,4 @@ export default class TrayIcon { __dirname, '..', 'assets', 'images', type, platform, `${asset}.${FILE_EXTENSION}`, )); } - - // TODO: Extract this into a reusable component and remove the duplications - quitApp = () => { - const yesButtonIndex = 0; - let selection = yesButtonIndex; - if (window.ferdi.stores.settings.app.confirmOnQuit) { - selection = dialog.showMessageBoxSync(app.mainWindow, { - // TODO: Externalize strings - type: 'question', - message: 'Quit', - detail: 'Do you really want to quit Ferdi?', - buttons: ['Yes', 'No'], - }); - } - if (selection === yesButtonIndex) { - app.quit(); - } - }; } -- cgit v1.2.3-54-g00ecf