mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Fix crash when deleting conversation
This commit is contained in:
+9
-5
@@ -80,14 +80,18 @@ class ConversationInfoPresenter @Inject constructor(
|
||||
disposables += markUnarchived
|
||||
disposables += deleteConversations
|
||||
|
||||
val partsObservable = messageRepo.getPartsForConversation(threadId)
|
||||
.asObservable()
|
||||
.filter { parts -> parts.isLoaded && parts.isValid}
|
||||
|
||||
disposables += Observables
|
||||
.combineLatest(conversation, partsObservable) { conversation, parts ->
|
||||
.combineLatest(
|
||||
conversation,
|
||||
messageRepo.getPartsForConversation(threadId).asObservable()
|
||||
) { conversation, parts ->
|
||||
val data = mutableListOf<ConversationInfoItem>()
|
||||
|
||||
// If some data was deleted, this isn't the place to handle it
|
||||
if (!conversation.isLoaded || !conversation.isValid || !parts.isLoaded || !parts.isValid) {
|
||||
return@combineLatest
|
||||
}
|
||||
|
||||
data += conversation.recipients.map(::ConversationInfoRecipient)
|
||||
data += ConversationInfoItem.ConversationInfoSettings(
|
||||
name = conversation.name,
|
||||
|
||||
Reference in New Issue
Block a user