Call PostListModel.remove() async on main queue

This commit is contained in:
Angelo Stavrow 2020-11-02 13:09:38 -05:00
parent d129c0d0f9
commit 01bfe7e74a
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -20,7 +20,7 @@ struct ContentView: View {
primaryButton: .destructive(Text("Delete"), action: {
if let postToDelete = model.postToDelete {
model.selectedPost = nil
withAnimation {
DispatchQueue.main.async {
model.posts.remove(postToDelete)
}
model.postToDelete = nil