From 7d3325fdc614718abbe3ec0db03065cb4a33d02e Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 7 Mar 2021 23:51:51 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20ipcMain=20now=20uses=20handle=20ins?= =?UTF-8?q?tead=20of=20.on=20for=20=E2=9D=97=20config-request=20probably?= =?UTF-8?q?=20doesn't=20need=20to=20be=20async=20like=20at=20all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- freechat-client/main.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/freechat-client/main.js b/freechat-client/main.js index bb53618..7a9029a 100644 --- a/freechat-client/main.js +++ b/freechat-client/main.js @@ -51,12 +51,13 @@ app.on('activate', () => { }); // returns the config -ipcMain.on('config-request', (event, _arg) => { - event.returnValue = config +ipcMain.handle('config-request', async function(event, _arg) { + return config; }) -ipcMain.on('config-update', (event, data, target) => { - config = data // update in-memory config-file first - cfg.update_config(data, target) + +ipcMain.handle('config-update', function(event, data) { + config = data; + cfg.update_file(data, data['path']); })