project-client/src/main/ipc.ts

14 lines
359 B
TypeScript
Raw Normal View History

2023-04-04 08:35:37 +09:00
import { app, ipcMain } from "electron";
2023-04-04 07:41:52 +09:00
import { join } from "path";
2023-04-04 08:35:37 +09:00
import { GET_PRELOAD_FILE, RELAUNCH } from "../shared/IpcEvents";
2023-04-04 07:41:52 +09:00
import { VENCORD_FILES_DIR } from "./constants";
ipcMain.on(GET_PRELOAD_FILE, e => {
e.returnValue = join(VENCORD_FILES_DIR, "preload.js");
});
2023-04-04 08:35:37 +09:00
ipcMain.handle(RELAUNCH, () => {
app.relaunch();
app.exit();
});