mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -70,8 +70,8 @@ struct HomeScreenViewState: BindableState {
|
||||
var bindings = HomeScreenViewStateBindings()
|
||||
|
||||
var placeholderRooms: [HomeScreenRoom] {
|
||||
(1...10).map { index in
|
||||
HomeScreenRoom.placeholder(id: "\(index)")
|
||||
(1...10).map { _ in
|
||||
HomeScreenRoom.placeholder()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,8 +83,13 @@ struct HomeScreenViewStateBindings {
|
||||
}
|
||||
|
||||
struct HomeScreenRoom: Identifiable, Equatable {
|
||||
/// The list item identifier can be a real room identifier, a custom one for invalidated entries
|
||||
/// or a completely unique one for empty items and skeletons
|
||||
let id: String
|
||||
|
||||
/// The real room identifier this item points to
|
||||
let roomId: String?
|
||||
|
||||
let name: String
|
||||
|
||||
let hasUnreads: Bool
|
||||
@@ -93,12 +98,15 @@ struct HomeScreenRoom: Identifiable, Equatable {
|
||||
|
||||
var lastMessage: AttributedString?
|
||||
|
||||
var avatarURLString: String?
|
||||
|
||||
var avatar: UIImage?
|
||||
|
||||
var isPlaceholder = false
|
||||
|
||||
static func placeholder(id: String) -> HomeScreenRoom {
|
||||
HomeScreenRoom(id: id,
|
||||
static func placeholder() -> HomeScreenRoom {
|
||||
HomeScreenRoom(id: UUID().uuidString,
|
||||
roomId: nil,
|
||||
name: "Placeholder room name",
|
||||
hasUnreads: false,
|
||||
timestamp: "Now",
|
||||
|
||||
Reference in New Issue
Block a user