Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: New release v5.10.4 #1349

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion app/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type {Event} from "electron/common";
import {clipboard} from "electron/common";
import type {IpcMainEvent, WebContents} from "electron/main";
import {BrowserWindow, app, dialog, powerMonitor, session} from "electron/main";
import {
BrowserWindow,
app,
dialog,
powerMonitor,
session,
webContents,
} from "electron/main";
import {Buffer} from "node:buffer";
import crypto from "node:crypto";
import path from "node:path";
Expand Down Expand Up @@ -389,6 +396,21 @@ ${error}`,
},
);

ipcMain.on(
"forward-to",
<Channel extends keyof RendererMessage>(
_event: IpcMainEvent,
webContentsId: number,
listener: Channel,
...parameters: Parameters<RendererMessage[Channel]>
) => {
const contents = webContents.fromId(webContentsId);
if (contents !== undefined) {
send(contents, listener, ...parameters);
}
},
);

ipcMain.on("update-menu", (_event, props: MenuProps) => {
AppMenu.setMenu(props);
if (props.activeTabIndex !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion app/main/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {app} from "electron/main";

import * as Sentry from "@sentry/electron/main"; // eslint-disable-line n/file-extension-in-import
import * as Sentry from "@sentry/electron/main";

import {getConfigItem} from "../common/config-util.js";

Expand Down
9 changes: 9 additions & 0 deletions app/main/typed-ipc-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ export const ipcMain: {
...args: Parameters<RendererMessage[Channel]>
) => void,
): void;
on(
channel: "forward-to",
listener: <Channel extends keyof RendererMessage>(
event: IpcMainEvent,
webContentsId: number,
channel: Channel,
...args: Parameters<RendererMessage[Channel]>
) => void,
): void;
on<Channel extends keyof MainMessage>(
channel: Channel,
listener: MainListener<Channel>,
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/js/components/webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {Html} from "../../../common/html.js";
import {html} from "../../../common/html.js";
import type {RendererMessage} from "../../../common/typed-ipc.js";
import type {TabRole} from "../../../common/types.js";
import preloadCss from "../../css/preload.css?raw"; // eslint-disable-line n/file-extension-in-import
import preloadCss from "../../css/preload.css?raw";
import {ipcRenderer} from "../typed-ipc-renderer.js";
import * as SystemUtil from "../utils/system-util.js";

Expand Down Expand Up @@ -226,7 +226,7 @@ export default class WebView {
channel: Channel,
...args: Parameters<RendererMessage[Channel]>
): void {
ipcRenderer.sendTo(this.webContentsId, channel, ...args);
ipcRenderer.send("forward-to", this.webContentsId, channel, ...args);
}

private registerListeners(): void {
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/js/electron-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {EventEmitter} from "events"; // eslint-disable-line unicorn/prefer-node-protocol
import {EventEmitter} from "node:events";

import type {ClipboardDecrypter} from "./clipboard-decrypter.js";
import {ClipboardDecrypterImpl} from "./clipboard-decrypter.js";
Expand Down
12 changes: 6 additions & 6 deletions app/renderer/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ export class ServerManagerView {
ConfigUtil.getConfigItem("useSystemProxy", false)
? {mode: "system"}
: ConfigUtil.getConfigItem("useManualProxy", false)
? {
pacScript: ConfigUtil.getConfigItem("proxyPAC", ""),
proxyRules: ConfigUtil.getConfigItem("proxyRules", ""),
proxyBypassRules: ConfigUtil.getConfigItem("proxyBypass", ""),
}
: {mode: "direct"},
? {
pacScript: ConfigUtil.getConfigItem("proxyPAC", ""),
proxyRules: ConfigUtil.getConfigItem("proxyRules", ""),
proxyBypassRules: ConfigUtil.getConfigItem("proxyBypass", ""),
}
: {mode: "direct"},
);
}

Expand Down
3 changes: 2 additions & 1 deletion app/renderer/js/pages/preference/general-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ export function initGeneralSection({$root}: GeneralSectionProps): void {
const newValue = !ConfigUtil.getConfigItem("silent", true);
ConfigUtil.setConfigItem("silent", newValue);
updateSilentOption();
ipcRenderer.sendTo(
ipcRenderer.send(
"forward-to",
currentBrowserWindow.webContents.id,
"toggle-silent",
newValue,
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/js/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function sendAction<Channel extends keyof RendererMessage>(
win.restore();
}

ipcRenderer.sendTo(win.webContents.id, channel, ...args);
ipcRenderer.send("forward-to", win.webContents.id, channel, ...args);
}

const createTray = function (): void {
Expand Down
11 changes: 6 additions & 5 deletions app/renderer/js/typed-ipc-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export const ipcRenderer: {
rendererChannel: Channel,
...args: Parameters<RendererMessage[Channel]>
): void;
send<Channel extends keyof RendererMessage>(
channel: "forward-to",
webContentsId: number,
rendererChannel: Channel,
...args: Parameters<RendererMessage[Channel]>
): void;
send<Channel extends keyof MainMessage>(
channel: Channel,
...args: Parameters<MainMessage[Channel]>
Expand All @@ -56,11 +62,6 @@ export const ipcRenderer: {
: never,
transfer?: MessagePort[],
): void;
sendTo<Channel extends keyof RendererMessage>(
webContentsId: number,
channel: Channel,
...args: Parameters<RendererMessage[Channel]>
): void;
sendToHost<Channel extends keyof RendererMessage>(
channel: Channel,
...args: Parameters<RendererMessage[Channel]>
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to the Zulip desktop app are documented in this file.

### v5.10.4 --2024-01-09

**Dependencies**:

- Upgraded all dependencies, including Electron 28.1.1.

### v5.10.3 --2023-09-30

**Fixes**:
Expand Down
Loading