mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-23 06:08: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 += markUnarchived
|
||||||
disposables += deleteConversations
|
disposables += deleteConversations
|
||||||
|
|
||||||
val partsObservable = messageRepo.getPartsForConversation(threadId)
|
|
||||||
.asObservable()
|
|
||||||
.filter { parts -> parts.isLoaded && parts.isValid}
|
|
||||||
|
|
||||||
disposables += Observables
|
disposables += Observables
|
||||||
.combineLatest(conversation, partsObservable) { conversation, parts ->
|
.combineLatest(
|
||||||
|
conversation,
|
||||||
|
messageRepo.getPartsForConversation(threadId).asObservable()
|
||||||
|
) { conversation, parts ->
|
||||||
val data = mutableListOf<ConversationInfoItem>()
|
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 += conversation.recipients.map(::ConversationInfoRecipient)
|
||||||
data += ConversationInfoItem.ConversationInfoSettings(
|
data += ConversationInfoItem.ConversationInfoSettings(
|
||||||
name = conversation.name,
|
name = conversation.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user