We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1ed348 commit d3e89e2Copy full SHA for d3e89e2
iOS/PostEditor/PostEditorView.swift
@@ -136,6 +136,13 @@ struct PostEditorView: View {
136
model.move(post: post, from: selectedCollection, to: newCollection)
137
}
138
})
139
+ .onChange(of: post.status, perform: { value in
140
+ if value != PostStatus.published.rawValue {
141
+ self.model.editor.saveLastDraft(post)
142
+ } else {
143
+ self.model.editor.clearLastDraft()
144
+ }
145
+ })
146
.onAppear(perform: {
147
self.selectedCollection = collections.first { $0.alias == post.collectionAlias }
148
if post.status != PostStatus.published.rawValue {
0 commit comments