forked from upstream-mirrors/quik
Add better error handling for conversation loading
This commit is contained in:
@@ -178,10 +178,15 @@ class ComposeViewModel @Inject constructor(
|
|||||||
// monitors convos and triggers when wanted convo is present
|
// monitors convos and triggers when wanted convo is present
|
||||||
conversationRepo.getConversations(false)
|
conversationRepo.getConversations(false)
|
||||||
.asObservable()
|
.asObservable()
|
||||||
.filter { conversations -> conversations.isLoaded }
|
.filter { conversations -> conversations.isLoaded && conversations.isValid}
|
||||||
.mapNotNull { conversationRepo.getConversation(addresses) }
|
.mapNotNull { conversationRepo.getConversation(addresses) }
|
||||||
.doOnNext { newState { copy(loading = false) } }
|
.doOnNext { newState { copy(loading = false) } }
|
||||||
}
|
}
|
||||||
|
.doOnError { e ->
|
||||||
|
Timber.e(e, "Error while resolving conversation")
|
||||||
|
newState { copy(loading = false) }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Merges two potential conversation sources (constructor threadId and contact selection)
|
// Merges two potential conversation sources (constructor threadId and contact selection)
|
||||||
// into a single stream of conversations. If the conversation was deleted, notify the
|
// into a single stream of conversations. If the conversation was deleted, notify the
|
||||||
|
|||||||
Reference in New Issue
Block a user