Fix crash on deleting draft with attachments in share extension

This commit is contained in:
Shadowfacts 2023-05-04 10:11:04 -04:00
parent 3c13d2083b
commit bbdb7fe41f
1 changed files with 2 additions and 4 deletions

View File

@ -154,7 +154,7 @@ public final class ComposeController: ViewController {
if draft.hasContent {
isShowingSaveDraftSheet = true
} else {
DraftsPersistentContainer.shared.viewContext.delete(draft)
deleteDraftOnDisappear = true
config.dismiss(.cancel)
}
}
@ -162,9 +162,7 @@ public final class ComposeController: ViewController {
@MainActor
func cancel(deleteDraft: Bool) {
if deleteDraft {
DraftsPersistentContainer.shared.viewContext.delete(draft)
}
deleteDraftOnDisappear = true
config.dismiss(.cancel)
}