Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cac8ba7b authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Merge branch '6688-Fix_drawer_headerView_selection_not_updating' into 'main'

6688-Fix_drawer_headerView_selection_not_updating

See merge request !137
parents f36e2f0f 9ddc7d02
Loading
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -146,12 +146,10 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K

        accountsViewModel.displayAccountsLiveData.observeNotNull(parent) { accounts ->
            run {
                if (accounts != displayAccounts) {
                displayAccounts = accounts
                setAccounts(accounts)
            }
        }
        }

        foldersViewModel.getFolderListLiveData().observe(parent) { folderList ->
            setUserFolders(folderList)
@@ -278,8 +276,12 @@ 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) {