@@ -363,19 +363,21 @@ private extension MessagesCollectionView {
363
363
case let . added( newMessages, _) :
364
364
// get current snapshot and append new items
365
365
var snapshot = dataSource. snapshot ( )
366
- let existingIds = Set ( snapshot. itemIdentifiers)
366
+ // let existingIds = Set(snapshot.itemIdentifiers)
367
367
let newIds = newMessages. map ( \. id)
368
- let missingIds = newIds. filter { !existingIds. contains ( $0) }
368
+ // let missingIds = newIds.filter { !existingIds.contains($0) }
369
369
370
- guard !missingIds. isEmpty else { return }
370
+ // guard !missingIds.isEmpty else { return }
371
371
let shouldScroll = newMessages. contains {
372
372
$0. message. fromId == Auth . shared. getCurrentUserId ( )
373
373
}
374
374
375
375
if let first = snapshot. itemIdentifiers. first {
376
- snapshot. insertItems ( missingIds, beforeItem: first)
376
+ // snapshot.insertItems(missingIds, beforeItem: first)
377
+ snapshot. insertItems ( newIds, beforeItem: first)
377
378
} else {
378
- snapshot. appendItems ( missingIds, toSection: . main)
379
+ // snapshot.appendItems(missingIds, toSection: .main)
380
+ snapshot. appendItems ( newIds, toSection: . main)
379
381
}
380
382
381
383
// Mark as read if we're at bottom or message is from current user
0 commit comments