mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Move clear-last-draft call to PostEditor.onDisappear
This commit is contained in:
parent
3114d037b3
commit
1c9ca05527
@ -86,12 +86,6 @@ struct PostListView: View {
|
||||
)
|
||||
)
|
||||
.navigationSubtitle(postCount == 1 ? "\(postCount) post" : "\(postCount) posts")
|
||||
.onChange(of: selectedCollection, perform: { _ in
|
||||
DispatchQueue.main.async {
|
||||
self.model.selectedPost = nil
|
||||
self.model.editor.clearLastDraft()
|
||||
}
|
||||
})
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
@ -39,6 +39,9 @@ struct PostEditorView: View {
|
||||
}
|
||||
})
|
||||
.onDisappear(perform: {
|
||||
DispatchQueue.main.async {
|
||||
model.editor.clearLastDraft()
|
||||
}
|
||||
if post.title.count == 0
|
||||
&& post.body.count == 0
|
||||
&& post.status == PostStatus.local.rawValue
|
||||
|
Loading…
Reference in New Issue
Block a user