diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt index 32dc6ab177c463039ff448d6d1376ca7ac64229f..7ede9fa28ac8cc9d85b2fe9bf099b907eb53c4c2 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt @@ -146,10 +146,8 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K accountsViewModel.displayAccountsLiveData.observeNotNull(parent) { accounts -> run { - if (accounts != displayAccounts) { - displayAccounts = accounts - setAccounts(accounts) - } + displayAccounts = accounts + setAccounts(accounts) } } @@ -278,9 +276,13 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K headerView.clear() headerView.addProfiles(*accountItems) - newActiveProfile?.let { profile -> - headerView.activeProfile = profile - } + newActiveProfile + ?.takeIf { + it != headerView.activeProfile + }?.let { + headerView.activeProfile = it + headerView.updateHeaderAndList() + } if (oldSelectedBackgroundColor != selectedBackgroundColor) { // Recreate list of folders with updated account color