mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Room list fixes (#431)
* Fixes #396 - Avoid duplicates in room list, cleanup logic throughout * Re-enabled the allRoomsView with a hard 500 room limit and reduced the diffing collection time. * Fixes #385, #411 - Filter out spaces, invites and tombstoned rooms from the room list * Various tweaks following code review
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import MatrixRustSDK
|
||||
|
||||
enum RoomSummaryProviderState {
|
||||
case cold
|
||||
@@ -24,25 +25,18 @@ enum RoomSummaryProviderState {
|
||||
case live
|
||||
}
|
||||
|
||||
enum RoomSummary: Identifiable {
|
||||
case empty(id: String)
|
||||
enum RoomSummary {
|
||||
case empty
|
||||
case filled(details: RoomSummaryDetails)
|
||||
case invalidated(details: RoomSummaryDetails)
|
||||
|
||||
var id: String {
|
||||
var id: String? {
|
||||
switch self {
|
||||
case .empty(let id):
|
||||
return id
|
||||
case .filled(let summary):
|
||||
return summary.id
|
||||
}
|
||||
}
|
||||
|
||||
var asFilled: RoomSummaryDetails? {
|
||||
guard case let .filled(details) = self else {
|
||||
case .empty:
|
||||
return nil
|
||||
case .invalidated(let details), .filled(let details):
|
||||
return details.id
|
||||
}
|
||||
|
||||
return details
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user