Fix for update
This commit is contained in:
@@ -18,8 +18,7 @@ object AppModule {
|
|||||||
fun provideChatRepository(): ChatRepository {
|
fun provideChatRepository(): ChatRepository {
|
||||||
val host = "http://192.168.1.123:5738"
|
val host = "http://192.168.1.123:5738"
|
||||||
val client = RetrofitAPIClient(URL(host))
|
val client = RetrofitAPIClient(URL(host))
|
||||||
val apiInterface = client.getAPIInterface()
|
|
||||||
val database = CachedChatDatabase.liveDatabase()
|
val database = CachedChatDatabase.liveDatabase()
|
||||||
return ChatRepository(apiInterface, database)
|
return ChatRepository(client, database)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,5 +20,9 @@ class ConversationListViewModel @Inject constructor(
|
|||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
repository.synchronize()
|
repository.synchronize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModelScope.launch {
|
||||||
|
repository.beginWatchingForUpdates(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user