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