Clear last draft when leaving the editor

This commit is contained in:
Angelo Stavrow 2020-11-04 14:05:44 -05:00
parent 8f0d21c5e1
commit 14aed4a14d
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -145,6 +145,7 @@ struct PostEditorView: View {
} }
}) })
.onDisappear(perform: { .onDisappear(perform: {
self.model.editor.clearLastDraft()
if post.title.count == 0 if post.title.count == 0
&& post.body.count == 0 && post.body.count == 0
&& post.status == PostStatus.local.rawValue && post.status == PostStatus.local.rawValue