mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 04:29:45 +01:00
Add loading state
This commit is contained in:
parent
a695a8448d
commit
c7989f04ce
@ -63,6 +63,9 @@ class ConversationsListViewModel constructor(
|
|||||||
val searchQuery = MutableLiveData<String>()
|
val searchQuery = MutableLiveData<String>()
|
||||||
val currentUserLiveData: LiveData<UserNgEntity> = usersRepository.getActiveUserLiveData()
|
val currentUserLiveData: LiveData<UserNgEntity> = usersRepository.getActiveUserLiveData()
|
||||||
val conversationsLiveData = Transformations.switchMap(currentUserLiveData) {
|
val conversationsLiveData = Transformations.switchMap(currentUserLiveData) {
|
||||||
|
if (viewState.value != LOADING) {
|
||||||
|
viewState.value = LOADING
|
||||||
|
}
|
||||||
conversationsRepository.getConversationsForUser(it.id!!)
|
conversationsRepository.getConversationsForUser(it.id!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user