Fix IPC communication in Electron account store (#3952)

This commit is contained in:
Krzysztof Jelski 2020-10-31 13:52:14 +01:00 committed by GitHub
parent 3cdcd27f70
commit a640183600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -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);
});
}
};