Update settings.js

This commit is contained in:
Richie Bendall 2021-08-27 20:26:12 +12:00 committed by GitHub
parent 35ed1f82e0
commit df8c8bb6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -394,16 +394,20 @@ function processLogOut(val, isLastAccount, skip = false) {
val, val,
isLastAccount isLastAccount
} }
if (!skip) {
const parent = val.closest('.settingsAuthAccount') const parent = val.closest('.settingsAuthAccount')
const uuid = parent.getAttribute('uuid') const uuid = parent.getAttribute('uuid')
if (!skip) {
const account = ConfigManager.getAuthAccount(uuid) const account = ConfigManager.getAuthAccount(uuid)
if (account.type === 'microsoft') { if (account.type === 'microsoft') {
toggleOverlay(true, false, 'msOverlay') toggleOverlay(true, false, 'msOverlay')
ipcRenderer.send('openMSALogoutWindow', 'open') ipcRenderer.send('openMSALogoutWindow', 'open')
} }
} }
const prevSelAcc = ConfigManager.getSelectedAccount() const prevSelAcc = ConfigManager.getSelectedAccount()
AuthManager.removeAccount(uuid).then(() => { AuthManager.removeAccount(uuid).then(() => {
if(!isLastAccount && uuid === prevSelAcc.uuid){ if(!isLastAccount && uuid === prevSelAcc.uuid){
const selAcc = ConfigManager.getSelectedAccount() const selAcc = ConfigManager.getSelectedAccount()
@ -412,6 +416,7 @@ function processLogOut(val, isLastAccount, skip = false) {
validateSelectedAccount() validateSelectedAccount()
} }
}) })
$(parent).fadeOut(250, () => { $(parent).fadeOut(250, () => {
parent.remove() parent.remove()
}) })