From 2797dc26bd4ff09326359db2ddd020ddc9d407d9 Mon Sep 17 00:00:00 2001 From: badspider7 <1742969779@qq.com> Date: Thu, 28 Mar 2024 13:43:58 +0800 Subject: [PATCH] fix: resolve ipcRenderer no returns --- electron/preload.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/electron/preload.ts b/electron/preload.ts index e385424..13317f2 100644 --- a/electron/preload.ts +++ b/electron/preload.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.