Fix crash on deleting draft with attachments in share extension
This commit is contained in:
parent
3c13d2083b
commit
bbdb7fe41f
|
@ -154,7 +154,7 @@ public final class ComposeController: ViewController {
|
||||||
if draft.hasContent {
|
if draft.hasContent {
|
||||||
isShowingSaveDraftSheet = true
|
isShowingSaveDraftSheet = true
|
||||||
} else {
|
} else {
|
||||||
DraftsPersistentContainer.shared.viewContext.delete(draft)
|
deleteDraftOnDisappear = true
|
||||||
config.dismiss(.cancel)
|
config.dismiss(.cancel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,9 +162,7 @@ public final class ComposeController: ViewController {
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
func cancel(deleteDraft: Bool) {
|
func cancel(deleteDraft: Bool) {
|
||||||
if deleteDraft {
|
deleteDraftOnDisappear = true
|
||||||
DraftsPersistentContainer.shared.viewContext.delete(draft)
|
|
||||||
}
|
|
||||||
config.dismiss(.cancel)
|
config.dismiss(.cancel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue