Add AuthenticationHomeserverViewData to easily map AuthenticationState.Homeserver to a type in the SwiftUI target.

This commit is contained in:
Doug
2022-05-24 13:41:47 +01:00
parent a74134fdba
commit ac4572ae6a
22 changed files with 147 additions and 197 deletions
@@ -33,7 +33,7 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
// MARK: - Setup
init(homeserverAddress: String, hasModalPresentation: Bool) {
let bindings = AuthenticationServerSelectionBindings(homeserverAddress: HomeserverAddress.displayable(homeserverAddress))
let bindings = AuthenticationServerSelectionBindings(homeserverAddress: homeserverAddress)
super.init(initialViewState: AuthenticationServerSelectionViewState(bindings: bindings,
hasModalPresentation: hasModalPresentation))
}
@@ -58,7 +58,7 @@ final class AuthenticationServerSelectionCoordinator: Coordinator, Presentable {
self.parameters = parameters
let homeserver = parameters.authenticationService.state.homeserver
let viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: homeserver.addressFromUser ?? homeserver.address,
let viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: homeserver.displayableAddress,
hasModalPresentation: parameters.hasModalPresentation)
let view = AuthenticationServerSelectionScreen(viewModel: viewModel.context)
authenticationServerSelectionViewModel = viewModel