Ver Fonte

:art: fix https://github.com/siyuan-note/siyuan/issues/9128

Vanessa há 1 ano atrás
pai
commit
dc92bfdc8f
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      app/src/window/closeWin.ts

+ 9 - 0
app/src/window/closeWin.ts

@@ -0,0 +1,9 @@
+import {App} from "../index";
+import {getCurrentWindow} from "@electron/remote";
+
+export const closeWindow = async (app: App) => {
+    for (let i = 0; i < app.plugins.length; i++) {
+        await app.plugins[i].onunload();
+    }
+    getCurrentWindow().destroy();
+}