close on exit
mellobacon committed
Aug 25, 2022 at 13:37 UTC
3d1a14e0a5eeb4830380f26fd28fad11fde221b3
1 file changed
+2
-1
src/components/Menu/menu.ts
+2
-1
@@ -2,6 +2,7 @@ import { filetree, workspacename } from "../FileTree/TreeStore";
2
import { data, workspace } from "../FileTree/TreeData";
3
import { addTab } from "../Content/Editor/Tabs";
4
import { dialog } from "@tauri-apps/api";
5
+import { appWindow } from "@tauri-apps/api/window";
6
export const filemenu = [
7
{ option: "New File...", shortcut: "Ctrl + N", onclick: async () => { console.log("click"); } },
8
{ option: "Open File...", shortcut: "Ctrl + O", onclick: async () => {
@@ -19,7 +20,7 @@ export const filemenu = [
20
{ option: "Save File As...", shortcut: "Ctrl + Shift + S", onclick: () => { console.log("click"); } },
21
{ option: "Save All", shortcut: "Ctrl + Shift + K", onclick: () => { console.log("click"); } },
22
{ option: "Settings", onclick: () => { console.log("click"); }, divider: true },
22
- { option: "Exit", onclick: () => { console.log("click"); } }
23
+ { option: "Exit", onclick: async () => { await appWindow.close(); } }
24
];
25
export const editmenu = [
26
{ option: "Undo", shortcut: "Ctrl + Z", onclick: () => { console.log("click"); } },