mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Adopt StateStoreViewModelV2 in the authentication screens and some settings screens. (#4083)
* Add some tests for DeferredFulfillment with Observation. * Use StateStoreViewModelV2 in AuthenticationStartScreen. * Use StateStoreViewModelV2 in ServerConfirmationScreen. * Use StateStoreViewModelV2 in ServerSelectionScreen. * Use StateStoreViewModelV2 in SoftLogoutScreen. * Use StateStoreViewModelV2 in SettingsScreen. * Use StateStoreViewModelV2 in DeveloperOptionsScreen. * Use StateStoreViewModelV2 in AdvancedSettingsScreen.
This commit is contained in:
+2
-4
@@ -8,7 +8,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ServerSelectionScreen: View {
|
||||
@ObservedObject var context: ServerSelectionScreenViewModel.Context
|
||||
@Bindable var context: ServerSelectionScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
@@ -107,9 +107,7 @@ struct ServerSelection_Previews: PreviewProvider, TestablePreview {
|
||||
NavigationStack {
|
||||
ServerSelectionScreen(context: invalidViewModel.context)
|
||||
}
|
||||
.snapshotPreferences(expect: invalidViewModel.context.$viewState.map { state in
|
||||
state.hasValidationError == true
|
||||
})
|
||||
.snapshotPreferences(expect: invalidViewModel.context.observe(\.viewState.hasValidationError))
|
||||
}
|
||||
|
||||
static func makeViewModel(for homeserverAddress: String) -> ServerSelectionScreenViewModel {
|
||||
|
||||
Reference in New Issue
Block a user