Reuse previously build room summaries for diffs that contain invalidations
This commit is contained in:
committed by
Stefan Ceriu
parent
54a7e7acf0
commit
4c45d8722c
@@ -177,7 +177,18 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
case .filled(let roomId):
|
||||
return buildRoomSummaryForIdentifier(roomId, invalidated: false)
|
||||
case .invalidated(let roomId):
|
||||
return buildRoomSummaryForIdentifier(roomId, invalidated: true)
|
||||
guard let cachedRoom = rooms.first(where: { $0.id == roomId }) else {
|
||||
return buildRoomSummaryForIdentifier(roomId, invalidated: true)
|
||||
}
|
||||
|
||||
switch cachedRoom {
|
||||
case .empty:
|
||||
return .empty
|
||||
case .filled(let details):
|
||||
return .invalidated(details: details)
|
||||
case .invalidated:
|
||||
return cachedRoom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user