This commit is contained in:
nrobi144
2026-01-03 13:00:02 +02:00
parent f800e20b05
commit 64eec9844b
5 changed files with 406 additions and 11 deletions
@@ -200,7 +200,7 @@ class EventCollectionState<T : Any>(
// Sort if comparator provided, otherwise keep newest first (pending items already at end)
val sorted =
if (sortComparator != null) {
merged.sortedWith(sortComparator)
merged.sortedWith(sortComparator).distinctBy { getId(it) }
} else {
// Reverse so newest (pending) items come first
(pendingItems.reversed() + _items.value).distinctBy { getId(it) }