partey_workadventure/desktop/src/ipc.ts

19 lines
454 B
TypeScript
Raw Normal View History

2022-02-17 19:48:08 +01:00
import { ipcMain } from "electron";
import { createAndShowNotification } from "./notification";
import { getWindow } from "./window";
export function emitMutedKeyPress() {
const mainWindow = getWindow();
if (!mainWindow) {
throw new Error("Main window not found");
}
mainWindow.webContents.send("on-muted-key-press");
}
export default () => {
ipcMain.on("notify", (event, txt) => {
createAndShowNotification({ body: txt });
});
};