mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54: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 itemsBefore = context.coordinator.items
|
||||||
let itemsAfter = items
|
let itemsAfter = items
|
||||||
context.coordinator.items = items
|
context.coordinator.items = items
|
||||||
|
// guard itemsBefore != itemsAfter else { return }
|
||||||
Task.detached {
|
Task.detached {
|
||||||
if itemsAfter.count == 0 {
|
if itemsBefore.count-itemsAfter.count > 10_000 {
|
||||||
|
//removing more than 10k
|
||||||
await context.coordinator.instantApplySnapshot()
|
await context.coordinator.instantApplySnapshot()
|
||||||
} else {
|
} else {
|
||||||
await context.coordinator.applySnapshot(animated: true)
|
await context.coordinator.applySnapshot(animated: true)
|
||||||
|
|||||||