diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift index 31a3569c..0762c2d3 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentRowController.swift @@ -49,7 +49,9 @@ class AttachmentRowController: ViewController { private func removeAttachment() { withAnimation { - parent.draft.attachments.remove(attachment) + var newAttachments = parent.draft.draftAttachments + newAttachments.removeAll(where: { $0.id == attachment.id }) + parent.draft.attachments = NSMutableOrderedSet(array: newAttachments) } }