mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 03:06:37 +00:00
Implement TimelineItemProvider diff truncate mechanism
This commit is contained in:
@@ -175,8 +175,10 @@ class TimelineItemProvider: TimelineItemProviderProtocol {
|
||||
let itemProxy = TimelineItemProxy(item: item)
|
||||
changes.append(.remove(offset: Int(index), element: itemProxy, associatedWith: nil))
|
||||
changes.append(.insert(offset: Int(index), element: itemProxy, associatedWith: nil))
|
||||
case .truncate:
|
||||
break
|
||||
case .truncate(let length):
|
||||
for (index, itemProxy) in itemProxies.enumerated() where index >= Int(length) {
|
||||
changes.append(.remove(offset: index, element: itemProxy, associatedWith: nil))
|
||||
}
|
||||
}
|
||||
|
||||
return CollectionDifference(changes)
|
||||
|
||||
Reference in New Issue
Block a user