Fix rooms not showing up as placeholders after switching from the skeletons state

This commit is contained in:
Stefan Ceriu
2022-11-24 17:10:53 +02:00
committed by Stefan Ceriu
parent 7d8e94d3a7
commit 03130f41fb
2 changed files with 10 additions and 2 deletions
@@ -94,12 +94,15 @@ struct HomeScreenRoom: Identifiable, Equatable {
var avatar: UIImage?
var isPlaceholder = false
static func placeholder(id: String) -> HomeScreenRoom {
HomeScreenRoom(id: id,
name: "Placeholder room name",
hasUnreads: false,
timestamp: "Now",
lastMessage: AttributedString("Last message"),
avatar: UIImage(systemName: "photo"))
avatar: UIImage(systemName: "photo"),
isPlaceholder: true)
}
}
@@ -40,7 +40,12 @@ struct HomeScreen: View {
} else {
LazyVStack {
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)