Fix settings UI not updating.

This commit is contained in:
Daniel Scalzi 2022-02-07 00:55:54 -05:00
parent 5ea12d469b
commit 2a99d72dde
No known key found for this signature in database
GPG Key ID: 9E3E2AFE45328AA5

View File

@ -387,6 +387,7 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => {
AuthManager.addMicrosoftAccount(authCode).then(value => { AuthManager.addMicrosoftAccount(authCode).then(value => {
updateSelectedAccount(value) updateSelectedAccount(value)
switchView(getCurrentView(), VIEWS.settings, 500, 500, () => { switchView(getCurrentView(), VIEWS.settings, 500, 500, () => {
prepareSettings()
}) })
}) })
} }
@ -451,6 +452,7 @@ function bindAuthAccountLogOut(){
}) })
} }
let msAccDomElementCache
/** /**
* Process a log out. * Process a log out.
* *
@ -463,6 +465,7 @@ function processLogOut(val, isLastAccount){
const prevSelAcc = ConfigManager.getSelectedAccount() const prevSelAcc = ConfigManager.getSelectedAccount()
const targetAcc = ConfigManager.getAuthAccount(uuid) const targetAcc = ConfigManager.getAuthAccount(uuid)
if(targetAcc.type === 'microsoft') { if(targetAcc.type === 'microsoft') {
msAccDomElementCache = parent
switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => { switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => {
ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount) ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount)
}) })
@ -520,6 +523,10 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGOUT, (_, ...arguments_) => {
updateSelectedAccount(selAcc) updateSelectedAccount(selAcc)
validateSelectedAccount() validateSelectedAccount()
} }
if(msAccDomElementCache) {
msAccDomElementCache.remove()
msAccDomElementCache = null
}
}) })
.finally(() => { .finally(() => {
switchView(getCurrentView(), VIEWS.settings, 500, 500) switchView(getCurrentView(), VIEWS.settings, 500, 500)