Fix IPC communication in Electron account store (#3952)
This commit is contained in:
parent
3cdcd27f70
commit
a640183600
@ -2,5 +2,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export type IpcMainHandler = {
|
||||
[channel: string]: (...args: any[]) => Promise<void> | any
|
||||
[channel: string]: (...args: any[]) => unknown
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@ import { IpcMainHandler } from './ipc-main-handler';
|
||||
|
||||
export const registerIpcHandler = (ipcHandler: IpcMainHandler): void => {
|
||||
for (const [channel, listener] of Object.entries(ipcHandler)) {
|
||||
ipcMain.handle(channel, (_, ...args): void => {
|
||||
listener(...args);
|
||||
ipcMain.handle(channel, (_, ...args) => {
|
||||
return listener(...args);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user