diff options
author | 0neGal <mail@0negal.com> | 2023-09-13 17:32:16 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-09-13 17:32:16 +0200 |
commit | 2302d7055a11adefe15bdaa5d8f94324d2fe293f (patch) | |
tree | 2c464faadd1bd3cfedf0a234afbd10f0100c8035 /src/app | |
parent | 14279b484ee8acbe440e09be25c36f8527592e75 (diff) | |
download | Viper-2302d7055a11adefe15bdaa5d8f94324d2fe293f.tar.gz Viper-2302d7055a11adefe15bdaa5d8f94324d2fe293f.zip |
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.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/main.js | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |