mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Disable swipe-to-delete for non-local posts
This commit is contained in:
parent
edec5e9087
commit
77262c9cd6
@ -38,12 +38,12 @@ struct PostListFilteredView: View {
|
||||
) {
|
||||
PostCellView(post: post)
|
||||
}
|
||||
}.onDelete(perform: { indexSet in
|
||||
.deleteDisabled(post.status != PostStatus.local.rawValue)
|
||||
}
|
||||
.onDelete(perform: { indexSet in
|
||||
for index in indexSet {
|
||||
let post = fetchRequest.wrappedValue[index]
|
||||
if post.status == PostStatus.local.rawValue {
|
||||
delete(post)
|
||||
}
|
||||
delete(post)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user