From bdedcf5bc0da92e3337595dd78c61319d0cb15b2 Mon Sep 17 00:00:00 2001 From: donskov Date: Thu, 1 Oct 2020 18:33:36 +0300 Subject: [PATCH] fix(main): fix question window result check --- src/main/ipc_messages.ts | 4 ++-- src/main/updater.ts | 4 ++-- src/main/windows/windows_controller.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/ipc_messages.ts b/src/main/ipc_messages.ts index 47f341d4..0ccf0a84 100644 --- a/src/main/ipc_messages.ts +++ b/src/main/ipc_messages.ts @@ -36,8 +36,8 @@ const initServerEvents = (server: any) => { id: 'question.2key.remove', result: 0, }, - async (result) => { - if (result) { + async (params) => { + if (params.result) { logger.info(`Removing 2key session key ${arg}`); await ServerStorage.removeIdentity(server, arg); diff --git a/src/main/updater.ts b/src/main/updater.ts index 185751d5..d1dd8d1c 100644 --- a/src/main/updater.ts +++ b/src/main/updater.ts @@ -89,8 +89,8 @@ class Updater extends EventEmitter { showAgain: true, showAgainValue: false, }, - (result) => { - if (result) { + (params) => { + if (params.result) { // yes logger.info(`User agreed to download new version ${update.version}`); diff --git a/src/main/windows/windows_controller.ts b/src/main/windows/windows_controller.ts index 3fd38814..2d3cf9b8 100644 --- a/src/main/windows/windows_controller.ts +++ b/src/main/windows/windows_controller.ts @@ -216,7 +216,7 @@ class WindowsController { // eslint-disable-next-line class-methods-use-this showQuestionWindow( params: IQuestionWindowParams, - onClosed: (result: number) => void, + onClosed: (params: IQuestionWindowParams) => void, parent?: ElectronWindow, ) { if ( @@ -245,7 +245,7 @@ class WindowsController { onClosed: () => { DialogsStorage.onDialogClose(browserWindow.window); - onClosed(params.result); + onClosed(browserWindow.window.params as IQuestionWindowParams); }, }); }