Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
ensure we don't re-save same attachment with localId after it has been
Browse files Browse the repository at this point in the history
uploaded
  • Loading branch information
Zorica Stojchevska committed Dec 30, 2022
1 parent acda80c commit a247af2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class CreateDraftWorker @AssistedInject constructor(
MessageUtils.isLocalMessageId(message.messageId)

private suspend fun updateStoredLocalDraft(apiDraft: Message, localDraft: Message) {
val localAttachments = localDraft.attachments.filterNot { it.isUploaded }
val localAttachments = localDraft.attachments.filterNot { it.isUploaded || it.isUploading }
apiDraft.apply {
dbId = localDraft.dbId
toList = localDraft.toList
Expand Down

0 comments on commit a247af2

Please sign in to comment.