mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Make adding and deleting posts more reliable/crashproof
This commit is contained in:
parent
5ca32ddcfc
commit
8ff1de188b
@ -42,7 +42,9 @@ struct ContentView: View {
|
||||
managedPost.rtl = Locale.characterDirection(forLanguage: languageCode) == .rightToLeft
|
||||
}
|
||||
withAnimation {
|
||||
self.model.selectedPost = managedPost
|
||||
DispatchQueue.main.async {
|
||||
self.model.selectedPost = managedPost
|
||||
}
|
||||
}
|
||||
}, label: { Image(systemName: "square.and.pencil") })
|
||||
}
|
||||
|
@ -103,7 +103,9 @@ struct PostListFilteredView: View {
|
||||
}
|
||||
|
||||
func delete(_ post: WFAPost) {
|
||||
model.posts.remove(post)
|
||||
DispatchQueue.main.async {
|
||||
model.posts.remove(post)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user