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

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

6688-Fix_drawer_headerView_selection_not_updating

parent 27e8dfbe
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -146,12 +146,10 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K


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


        foldersViewModel.getFolderListLiveData().observe(parent) { folderList ->
        foldersViewModel.getFolderListLiveData().observe(parent) { folderList ->
            setUserFolders(folderList)
            setUserFolders(folderList)
@@ -278,8 +276,12 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K
        headerView.clear()
        headerView.clear()
        headerView.addProfiles(*accountItems)
        headerView.addProfiles(*accountItems)


        newActiveProfile?.let { profile ->
        newActiveProfile
            headerView.activeProfile = profile
            ?.takeIf {
                it != headerView.activeProfile
            }?.let {
                headerView.activeProfile = it
                headerView.updateHeaderAndList()
            }
            }


        if (oldSelectedBackgroundColor != selectedBackgroundColor) {
        if (oldSelectedBackgroundColor != selectedBackgroundColor) {