forked from shadowfacts/Tusker
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 {
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue