siyuan/app/src/window/closeWin.ts

15 lines
396 B
TypeScript
Raw Normal View History

import {App} from "../index";
import {Constants} from "../constants";
import { ipcRenderer } from "electron";
export const closeWindow = async (app: App) => {
for (let i = 0; i < app.plugins.length; i++) {
try {
await app.plugins[i].onunload();
} catch (e) {
console.error(e);
}
}
ipcRenderer.send(Constants.SIYUAN_CMD, "destroy");
2023-09-17 22:27:55 +08:00
};