mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
instant reload if removing more than 10k items
This commit is contained in:
1 file changed
+3
-1
@@ -26,8 +26,10 @@ struct EmojiTableView: UIViewRepresentable {
|
||||
let itemsBefore = context.coordinator.items
|
||||
let itemsAfter = items
|
||||
context.coordinator.items = items
|
||||
// guard itemsBefore != itemsAfter else { return }
|
||||
Task.detached {
|
||||
if itemsAfter.count == 0 {
|
||||
if itemsBefore.count-itemsAfter.count > 10_000 {
|
||||
//removing more than 10k
|
||||
await context.coordinator.instantApplySnapshot()
|
||||
} else {
|
||||
await context.coordinator.applySnapshot(animated: true)
|
||||
|
||||