Add room's update publisher (#952)

* Add room update publisher

* Cleanup

* Update room’s title

* Add refresh logic in RoomDetailsScreenViewModel

* Fix UTs

* Add UT

* Update timeline listener in RoomProxy

* Fix caching in LoadableAvatarImage

* Cleanup

* Update RoomProxy api

* Inject room proxy in RoomScreenViewModel

* Cleanup

* Fix UTs
This commit is contained in:
Alfonso Grillo
2023-05-25 12:42:58 +02:00
committed by GitHub
parent c59921103d
commit bf2102e5d1
15 changed files with 169 additions and 105 deletions
@@ -59,8 +59,7 @@ struct RoomHeaderView_Previews: PreviewProvider {
static var bodyPlain: some View {
let viewModel = RoomScreenViewModel(timelineController: MockRoomTimelineController(),
mediaProvider: MockMediaProvider(),
roomName: "Some Room name",
roomAvatarUrl: URL.picturesDirectory)
roomProxy: RoomProxyMock(with: .init(displayName: "Some Room name", avatarURL: URL.picturesDirectory)))
RoomHeaderView(context: viewModel.context)
.previewLayout(.sizeThatFits)
@@ -71,8 +70,7 @@ struct RoomHeaderView_Previews: PreviewProvider {
static var bodyEncrypted: some View {
let viewModel = RoomScreenViewModel(timelineController: MockRoomTimelineController(),
mediaProvider: MockMediaProvider(),
roomName: "Some Room name",
roomAvatarUrl: nil)
roomProxy: RoomProxyMock(with: .init(displayName: "Some Room name")))
RoomHeaderView(context: viewModel.context)
.previewLayout(.sizeThatFits)