From 353f1f992a82358dba1cb345453c3fb6af1934d5 Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 4 Jun 2018 09:47:48 +0200 Subject: [PATCH] Faster app relaunch (old one was buggy and slow) In fact we don't even need to reload the whole app, a reload of the renderer does the job. :dab: --- src/components/SettingsPage/sections/Profile.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/SettingsPage/sections/Profile.js b/src/components/SettingsPage/sections/Profile.js index 8c9e6e31..008e2bc8 100644 --- a/src/components/SettingsPage/sections/Profile.js +++ b/src/components/SettingsPage/sections/Profile.js @@ -84,14 +84,13 @@ class TabProfile extends PureComponent { this.props.cleanAccountsCache() await delay(500) db.cleanCache() - remote.app.relaunch() - remote.app.exit() + remote.getCurrentWindow().webContents.reload() } - handleHardReset = () => { + handleHardReset = async () => { db.resetAll() - remote.app.relaunch() - remote.app.exit() + await delay(500) + remote.getCurrentWindow().webContents.reload() } handleChangePasswordCheck = isChecked => {