Skip to content

Commit d129c0d

Browse files
committed
Save/clear last draft based on status when loading post in editor
1 parent 4ef4045 commit d129c0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

iOS/PostEditor/PostEditorView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ struct PostEditorView: View {
137137
})
138138
.onAppear(perform: {
139139
self.selectedCollection = collections.first { $0.alias == post.collectionAlias }
140+
if post.status != PostStatus.published.rawValue {
141+
self.model.editor.saveLastDraft(post)
142+
} else {
143+
self.model.editor.clearLastDraft()
144+
}
140145
})
141146
.onDisappear(perform: {
142147
if post.title.count == 0

0 commit comments

Comments
 (0)