Fix list updates (it was isEqual)
This commit is contained in:
@@ -30,7 +30,7 @@ fun ConversationListScreen(
|
||||
viewModel: ConversationListViewModel = hiltViewModel(),
|
||||
onConversationSelected: (conversationID: String) -> Unit
|
||||
) {
|
||||
val conversations by viewModel.conversations.collectAsStateWithLifecycle(initialValue = listOf())
|
||||
val conversations by viewModel.conversations.collectAsStateWithLifecycle(initialValue = emptyList())
|
||||
ConversationListView(conversations = conversations, onConversationSelected = onConversationSelected)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@ class ConversationListViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
// TODO: Is this the best place to put these?
|
||||
// TODO: Need error handling (exceptions thrown below)
|
||||
|
||||
viewModelScope.launch {
|
||||
repository.synchronize()
|
||||
}
|
||||
@@ -31,11 +34,5 @@ class ConversationListViewModel @Inject constructor(
|
||||
viewModelScope.launch {
|
||||
repository.beginWatchingForUpdates(this)
|
||||
}
|
||||
|
||||
viewModelScope.launch {
|
||||
repository.conversationChanges.collect {
|
||||
Log.v("ViewModel", "Got conversationChanges")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user