From a085952032a36ddf03c7c46c4f6074d7f18bfee1 Mon Sep 17 00:00:00 2001 From: Haojie Ning <54093230+badspider7@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:08:07 +0800 Subject: [PATCH] fix: resolve ipcRenderer no returns (#478) --- electron/preload/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/electron/preload/index.ts b/electron/preload/index.ts index 396b771..53b585f 100644 --- a/electron/preload/index.ts +++ b/electron/preload/index.ts @@ -4,19 +4,19 @@ import { ipcRenderer, contextBridge } from 'electron' contextBridge.exposeInMainWorld('ipcRenderer', { on(...args: Parameters) { const [channel, listener] = args - ipcRenderer.on(channel, (event, ...args) => listener(event, ...args)) + return ipcRenderer.on(channel, (event, ...args) => listener(event, ...args)) }, off(...args: Parameters) { const [channel, ...omit] = args - ipcRenderer.off(channel, ...omit) + return ipcRenderer.off(channel, ...omit) }, send(...args: Parameters) { const [channel, ...omit] = args - ipcRenderer.send(channel, ...omit) + return ipcRenderer.send(channel, ...omit) }, invoke(...args: Parameters) { const [channel, ...omit] = args - ipcRenderer.invoke(channel, ...omit) + return ipcRenderer.invoke(channel, ...omit) }, // You can expose other APTs you need here.