Files
zulip-desktop/app/renderer/js/notification/helpers.ts
2021-04-25 19:57:38 -07:00

19 lines
522 B
TypeScript

import {ipcRenderer, remote} from "electron";
// Do not change this
export const appId = "org.zulip.zulip-electron";
const currentWindow = remote.getCurrentWindow();
const webContents = remote.getCurrentWebContents();
const webContentsId = webContents.id;
// This function will focus the server that sent
// the notification. Main function implemented in main.js
export function focusCurrentServer(): void {
ipcRenderer.sendTo(
currentWindow.webContents.id,
"focus-webview-with-id",
webContentsId,
);
}