Fixed crash & wrong registration status when deleting default account
This commit is contained in:
parent
8b417fe436
commit
c8f2fd34af
2 changed files with 5 additions and 0 deletions
|
@ -76,6 +76,7 @@ class SideMenuViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
fun updateAccountsList() {
|
||||
defaultAccountFound.value = false // Do not assume a default account will still be found
|
||||
val list = arrayListOf<AccountSettingsViewModel>()
|
||||
if (coreContext.core.accountList.isNotEmpty()) {
|
||||
val defaultAccount = coreContext.core.defaultAccount
|
||||
|
|
|
@ -43,6 +43,10 @@ open class StatusViewModel : ViewModel() {
|
|||
) {
|
||||
if (account == core.defaultAccount) {
|
||||
updateDefaultAccountRegistrationStatus(state)
|
||||
} else if (core.accountList.isEmpty()) {
|
||||
// Update registration status when default account is removed
|
||||
registrationStatusText.value = getStatusIconText(state)
|
||||
registrationStatusDrawable.value = getStatusIconResource(state)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue