mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Replace all uses of stopServicesAndExitApp with requestQuitOfApp
- Also updated tests with new behaviour Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
4ff3186ca7
commit
2c4a7ecfb4
8 files changed
+43
-110
No files matched your search
+2
-7
@@ -4,28 +4,23 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import applicationMenuItemInjectionToken from "../../application-menu-item-injection-token";
|
||||
import stopServicesAndExitAppInjectable from "../../../../../../main/stop-services-and-exit-app.injectable";
|
||||
import isMacInjectable from "../../../../../../common/vars/is-mac.injectable";
|
||||
import requestQuitOfAppInjectable from "../../../../../../main/electron-app/features/require-quit.injectable";
|
||||
|
||||
const quitApplicationMenuItemInjectable = getInjectable({
|
||||
id: "quit-application-menu-item",
|
||||
|
||||
instantiate: (di) => {
|
||||
const stopServicesAndExitApp = di.inject(stopServicesAndExitAppInjectable);
|
||||
const isMac = di.inject(isMacInjectable);
|
||||
|
||||
return {
|
||||
kind: "clickable-menu-item" as const,
|
||||
id: "quit",
|
||||
label: "Quit",
|
||||
|
||||
parentId: isMac ? "mac" : "file",
|
||||
orderNumber: isMac ? 140 : 70,
|
||||
keyboardShortcut: isMac ? "Cmd+Q" : "Alt+F4",
|
||||
|
||||
onClick: () => {
|
||||
stopServicesAndExitApp();
|
||||
},
|
||||
onClick: di.inject(requestQuitOfAppInjectable),
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user