Files
zulip-desktop/app/renderer/js/notification/helpers.ts
Anders Kaseorg 79f9362736 Strongly type IPC messages.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-25 20:44:05 -07:00

21 lines
561 B
TypeScript

import {remote} from "electron";
import {ipcRenderer} from "../typed-ipc-renderer";
// 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,
);
}