Fix Delete attachment context menu action not working

Closes #394
This commit is contained in:
Shadowfacts 2023-05-27 15:28:39 -07:00
parent d938c555b7
commit c0148bb770
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}
}