mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix rooms not showing up as placeholders after switching from the skeletons state
This commit is contained in:
committed by
Stefan Ceriu
parent
7d8e94d3a7
commit
03130f41fb
@@ -94,12 +94,15 @@ struct HomeScreenRoom: Identifiable, Equatable {
|
|||||||
|
|
||||||
var avatar: UIImage?
|
var avatar: UIImage?
|
||||||
|
|
||||||
|
var isPlaceholder = false
|
||||||
|
|
||||||
static func placeholder(id: String) -> HomeScreenRoom {
|
static func placeholder(id: String) -> HomeScreenRoom {
|
||||||
HomeScreenRoom(id: id,
|
HomeScreenRoom(id: id,
|
||||||
name: "Placeholder room name",
|
name: "Placeholder room name",
|
||||||
hasUnreads: false,
|
hasUnreads: false,
|
||||||
timestamp: "Now",
|
timestamp: "Now",
|
||||||
lastMessage: AttributedString("Last message"),
|
lastMessage: AttributedString("Last message"),
|
||||||
avatar: UIImage(systemName: "photo"))
|
avatar: UIImage(systemName: "photo"),
|
||||||
|
isPlaceholder: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ struct HomeScreen: View {
|
|||||||
} else {
|
} else {
|
||||||
LazyVStack {
|
LazyVStack {
|
||||||
ForEach(context.viewState.visibleRooms) { room in
|
ForEach(context.viewState.visibleRooms) { room in
|
||||||
HomeScreenRoomCell(room: room, context: context)
|
if room.isPlaceholder {
|
||||||
|
HomeScreenRoomCell(room: room, context: context)
|
||||||
|
.redacted(reason: .placeholder)
|
||||||
|
} else {
|
||||||
|
HomeScreenRoomCell(room: room, context: context)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
|||||||
Reference in New Issue
Block a user