deleting works from context menu, eg downloadedview

This commit is contained in:
neon443 committed 2026-04-30 13:35:33 +01:00
1 parent f7010d29ff
commit 24f12926a1
1 file changed
+9 -11
@@ -45,17 +45,11 @@ struct EmojiCollectionView: UIViewRepresentable {
}
}
// if items != context.coordinator.items || context.coordinator.pack != pack {
// context.coordinator.items = items
// context.coordinator.pack = pack
// uiView.reloadData()
// }
// let oldItems = context.coordinator.items
// let newItems = items
// newItems.difference(from: oldItems)
//// context.coordinator.items
// uiView.deleteItems(at: <#T##[IndexPath]#>)
if items != context.coordinator.items || context.coordinator.pack != pack {
context.coordinator.items = items
context.coordinator.pack = pack
uiView.reloadData()
}
}
func makeCoordinator() -> Coordinator {
@@ -218,6 +212,10 @@ struct EmojiCollectionView: UIViewRepresentable {
Task.detached {
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
}
self.items.remove(at: indexPath.row)
collectionView.performBatchUpdates {
collectionView.deleteItems(at: [indexPath])
}
}
delete.attributes.update(with: .destructive)
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.