mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Make .onDisappear conditional more reliable
This commit is contained in:
parent
f6b3690998
commit
aa1fddce92
@ -107,7 +107,7 @@ struct PostEditorView: View {
|
||||
}
|
||||
})
|
||||
.onDisappear(perform: {
|
||||
if post.status < PostStatus.published.rawValue {
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
LocalStorageManager().saveContext()
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ struct PostEditorView: View {
|
||||
}
|
||||
})
|
||||
.onDisappear(perform: {
|
||||
if post.status < PostStatus.published.rawValue {
|
||||
if post.status != PostStatus.published.rawValue {
|
||||
DispatchQueue.main.async {
|
||||
LocalStorageManager().saveContext()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user