From 2302d7055a11adefe15bdaa5d8f94324d2fe293f Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 13 Sep 2023 17:32:16 +0200 Subject: synchronize changes to settings from main process If the main process has changes to the settings, said settings will now also be sent to the renderer, making them synchronized. --- src/app/main.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/app') diff --git a/src/app/main.js b/src/app/main.js index 8775004..230bbf9 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -54,6 +54,15 @@ if (fs.existsSync("viper.json")) { setpath(); } +ipcRenderer.on("changed-settings", (e, new_settings) => { + // attempt to set `settings` to `new_settings` + try { + settings = { + ...settings, + ...new_settings + } + }catch(e) {} +}) // Show a toast message if no Internet connection has been detected. if (! navigator.onLine) { -- cgit v1.2.3