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

Commit 455b0f2c authored by morckx's avatar morckx
Browse files

Make MessageListViewModel.getFolders aware of account switches

parent 63154d06
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -12,10 +12,12 @@ import org.jetbrains.anko.coroutines.experimental.bg

class MessageListViewModel(private val folderRepositoryManager: FolderRepositoryManager) : ViewModel() {
    private val foldersLiveData = MutableLiveData<List<Folder>>()
    private var account: Account? = null


    fun getFolders(account: Account): LiveData<List<Folder>> {
        if (foldersLiveData.value == null) {
        if (foldersLiveData.value == null || this.account != account) {
            this.account = account
            loadFolders(account)
        }