Make .onDisappear conditional more reliable

This commit is contained in:
Angelo Stavrow 2020-09-23 14:36:52 -04:00
parent f6b3690998
commit aa1fddce92
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 2 additions and 2 deletions

View File

@ -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()
}

View File

@ -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()
}