mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Set lastDraft if post status changes to edited (or local)
This commit is contained in:
parent
bc77fa14af
commit
70189a6193
@ -106,6 +106,13 @@ struct PostEditorView: View {
|
||||
post.status = PostStatus.published.rawValue
|
||||
}
|
||||
})
|
||||
.onChange(of: post.status, perform: { _ in
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
model.editor.setLastDraft(post)
|
||||
}
|
||||
}
|
||||
})
|
||||
.onDisappear(perform: {
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
|
@ -128,6 +128,13 @@ struct PostEditorView: View {
|
||||
post.status = PostStatus.published.rawValue
|
||||
}
|
||||
})
|
||||
.onChange(of: post.status, perform: { _ in
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
model.editor.setLastDraft(post)
|
||||
}
|
||||
}
|
||||
})
|
||||
.onDisappear(perform: {
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
|
Loading…
Reference in New Issue
Block a user