forked from shadowfacts/Tusker
Fix crash when adding drawing attachment
This commit is contained in:
parent
8e570027a1
commit
7f64654800
|
@ -96,14 +96,17 @@ class AttachmentsListController: ViewController {
|
|||
}
|
||||
|
||||
private func addImage() {
|
||||
parent.deleteDraftOnDisappear = false
|
||||
parent.config.presentAssetPicker?({ results in
|
||||
self.insertAttachments(at: self.draft.attachments.count, itemProviders: results.map(\.itemProvider))
|
||||
})
|
||||
}
|
||||
|
||||
private func addDrawing() {
|
||||
parent.deleteDraftOnDisappear = false
|
||||
parent.config.presentDrawing?(PKDrawing()) { drawing in
|
||||
let attachment = DraftAttachment(context: DraftsPersistentContainer.shared.viewContext)
|
||||
attachment.id = UUID()
|
||||
attachment.drawing = drawing
|
||||
attachment.draft = self.draft
|
||||
self.draft.attachments.add(attachment)
|
||||
|
|
|
@ -208,6 +208,7 @@ public final class ComposeController: ViewController {
|
|||
do {
|
||||
try await poster.post()
|
||||
|
||||
deleteDraftOnDisappear = true
|
||||
didPostSuccessfully = true
|
||||
|
||||
// wait .25 seconds so the user can see the progress bar has completed
|
||||
|
|
Loading…
Reference in New Issue