From 098c4254d4c9b87f67e7050ace02087993b36ea8 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 4 May 2023 10:12:44 -0400 Subject: [PATCH] Fix deleted attachments reappearing --- .../ComposeUI/Controllers/AttachmentsListController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift index ee80b9a2b1..636970e3be 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift @@ -76,7 +76,9 @@ class AttachmentsListController: ViewController { } private func deleteAttachments(at indices: IndexSet) { - draft.attachments.removeObjects(at: indices) + var array = draft.draftAttachments + array.remove(atOffsets: indices) + draft.attachments = NSMutableOrderedSet(array: array) } private func insertAttachments(at offset: Int, itemProviders: [NSItemProvider]) {