From c1ed348c9649652b5beabca0b47b9b49ea86dda9 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 4 Nov 2020 14:07:02 -0500 Subject: [PATCH] Dispatch last-draft URL save to main queue to avoid iPad race condition --- iOS/PostEditor/PostEditorView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iOS/PostEditor/PostEditorView.swift b/iOS/PostEditor/PostEditorView.swift index 39c9839..9f67999 100644 --- a/iOS/PostEditor/PostEditorView.swift +++ b/iOS/PostEditor/PostEditorView.swift @@ -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() }