Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
Mauro
2024-05-20 14:37:45 +02:00
committed by GitHub
parent 3b82ce8def
commit 545b5c31cc
15 changed files with 192 additions and 95 deletions
@@ -77,8 +77,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
hideLoadingIndicator()
}
// We need an SDK update to pass the via into this preview.
switch await clientProxy.roomPreviewForIdentifier(roomID) {
switch await clientProxy.roomPreviewForIdentifier(roomID, via: via) {
case .success(let roomDetails):
state.roomDetails = roomDetails
case .failure:
@@ -148,20 +148,20 @@ struct JoinRoomScreen_Previews: PreviewProvider, TestablePreview {
}
if mode == .unknown {
clientProxy.roomPreviewForIdentifierReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
clientProxy.roomPreviewForIdentifierViaReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
} else {
clientProxy.roomPreviewForIdentifierReturnValue = .success(.init(roomID: "1",
name: "The Three-Body Problem - 三体",
canonicalAlias: "#3🌞problem:matrix.org",
// swiftlint:disable:next line_length
topic: "“Science and technology were the only keys to opening the door to the future, and people approached science with the faith and sincerity of elementary school students.”",
avatarURL: URL.homeDirectory,
memberCount: UInt(100),
isHistoryWorldReadable: false,
isJoined: membership.isJoined,
isInvited: membership.isInvited,
isPublic: membership.isPublic,
canKnock: membership.canKnock))
clientProxy.roomPreviewForIdentifierViaReturnValue = .success(.init(roomID: "1",
name: "The Three-Body Problem - 三体",
canonicalAlias: "#3🌞problem:matrix.org",
// swiftlint:disable:next line_length
topic: "“Science and technology were the only keys to opening the door to the future, and people approached science with the faith and sincerity of elementary school students.”",
avatarURL: URL.homeDirectory,
memberCount: UInt(100),
isHistoryWorldReadable: false,
isJoined: membership.isJoined,
isInvited: membership.isInvited,
isPublic: membership.isPublic,
canKnock: membership.canKnock))
}
return JoinRoomScreenViewModel(roomID: "1",