diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt index 9228a630..b61e8d63 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt @@ -178,10 +178,15 @@ class ComposeViewModel @Inject constructor( // monitors convos and triggers when wanted convo is present conversationRepo.getConversations(false) .asObservable() - .filter { conversations -> conversations.isLoaded } + .filter { conversations -> conversations.isLoaded && conversations.isValid} .mapNotNull { conversationRepo.getConversation(addresses) } .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) // into a single stream of conversations. If the conversation was deleted, notify the