Don't switch accounts when deleting unless deleting the current account

This commit is contained in:
Luna712 2023-11-05 14:51:56 -07:00
parent 352f90a08b
commit 76f63a7aa2

View file

@ -69,8 +69,10 @@ object AccountHelper {
currentAccounts.removeIf { it.keyIndex == account.keyIndex }
DataStoreHelper.accounts = currentAccounts.toTypedArray()
// Update UI
setAccount(getDefaultAccount(context))
if (account.keyIndex == DataStoreHelper.selectedKeyIndex) {
setAccount(getDefaultAccount(context))
}
callback.invoke(null)
dialog?.dismissSafe()
}