Dispatch last-draft URL save to main queue to avoid iPad race condition

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

View File

@ -139,7 +139,9 @@ struct PostEditorView: View {
.onAppear(perform: {
self.selectedCollection = collections.first { $0.alias == post.collectionAlias }
if post.status != PostStatus.published.rawValue {
self.model.editor.saveLastDraft(post)
DispatchQueue.main.async {
self.model.editor.saveLastDraft(post)
}
} else {
self.model.editor.clearLastDraft()
}