renderer: Use ipcRenderer.sendTo to communicate with other WebContents.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-25 19:34:34 -07:00
parent 3b3fa88c89
commit 994c412bd2
5 changed files with 26 additions and 23 deletions

View File

@@ -352,7 +352,11 @@ export function initGeneralSection(props: GeneralSectionProps): void {
const newValue = !ConfigUtil.getConfigItem("silent", true);
ConfigUtil.setConfigItem("silent", newValue);
updateSilentOption();
currentBrowserWindow.webContents.send("toggle-silent", newValue);
ipcRenderer.sendTo(
currentBrowserWindow.webContents.id,
"toggle-silent",
newValue,
);
},
});
}