From 2a99d72ddedd382781ec2b763f3678b2ffbb8a33 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Mon, 7 Feb 2022 00:55:54 -0500 Subject: [PATCH] Fix settings UI not updating. --- app/assets/js/scripts/settings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/assets/js/scripts/settings.js b/app/assets/js/scripts/settings.js index 73d6b6c2..b06ae6f0 100644 --- a/app/assets/js/scripts/settings.js +++ b/app/assets/js/scripts/settings.js @@ -387,6 +387,7 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => { AuthManager.addMicrosoftAccount(authCode).then(value => { updateSelectedAccount(value) switchView(getCurrentView(), VIEWS.settings, 500, 500, () => { + prepareSettings() }) }) } @@ -451,6 +452,7 @@ function bindAuthAccountLogOut(){ }) } +let msAccDomElementCache /** * Process a log out. * @@ -463,6 +465,7 @@ function processLogOut(val, isLastAccount){ const prevSelAcc = ConfigManager.getSelectedAccount() const targetAcc = ConfigManager.getAuthAccount(uuid) if(targetAcc.type === 'microsoft') { + msAccDomElementCache = parent switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => { ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount) }) @@ -520,6 +523,10 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGOUT, (_, ...arguments_) => { updateSelectedAccount(selAcc) validateSelectedAccount() } + if(msAccDomElementCache) { + msAccDomElementCache.remove() + msAccDomElementCache = null + } }) .finally(() => { switchView(getCurrentView(), VIEWS.settings, 500, 500)