Strongly type IPC messages.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-24 14:33:29 -07:00
parent 164038ec3c
commit 79f9362736
29 changed files with 372 additions and 83 deletions

View File

@@ -1,9 +1,10 @@
import {ipcRenderer, remote} from "electron";
import {remote} from "electron";
import {EventEmitter} from "events";
import {ClipboardDecrypterImpl} from "./clipboard-decrypter";
import type {NotificationData} from "./notification";
import {newNotification} from "./notification";
import {ipcRenderer} from "./typed-ipc-renderer";
type ListenerType = (...args: any[]) => void;
@@ -67,8 +68,11 @@ bridgeEvents.on("realm_icon_url", (iconURL: unknown) => {
}
const serverURL = location.origin;
iconURL = iconURL.includes("http") ? iconURL : `${serverURL}${iconURL}`;
ipcRenderer.send("realm-icon-changed", serverURL, iconURL);
ipcRenderer.send(
"realm-icon-changed",
serverURL,
iconURL.includes("http") ? iconURL : `${serverURL}${iconURL}`,
);
});
// Set user as active and update the time of last activity