Skip to content

Commit 6cd05c8

Browse files
committed
fixing homeserver edits not updating the selected server UI
1 parent abf35d7 commit 6cd05c8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ class OnboardingViewModel @AssistedInject constructor(
302302
authenticationDescription = awaitState().selectedAuthenticationState.description
303303
?: AuthenticationDescription.Register(AuthenticationDescription.AuthenticationType.Other)
304304
)
305-
RegistrationActionHandler.Result.StartRegistration -> _viewEvents.post(OnboardingViewEvents.DisplayStartRegistration)
305+
RegistrationActionHandler.Result.StartRegistration -> {
306+
overrideNextStage?.invoke() ?: _viewEvents.post(OnboardingViewEvents.DisplayStartRegistration)
307+
}
306308
RegistrationActionHandler.Result.UnsupportedStage -> _viewEvents.post(OnboardingViewEvents.DisplayRegistrationFallback)
307309
is RegistrationActionHandler.Result.SendEmailSuccess -> _viewEvents.post(OnboardingViewEvents.OnSendEmailSuccess(it.email))
308310
is RegistrationActionHandler.Result.SendMsisdnSuccess -> _viewEvents.post(OnboardingViewEvents.OnSendMsisdnSuccess(it.msisdn.msisdn))

vector/src/test/java/im/vector/app/features/onboarding/OnboardingViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ class OnboardingViewModelTest {
630630
private fun givenCanSuccessfullyUpdateHomeserver(homeserverUrl: String, resultingState: SelectedHomeserverState) {
631631
fakeHomeServerConnectionConfigFactory.givenConfigFor(homeserverUrl, A_HOMESERVER_CONFIG)
632632
fakeStartAuthenticationFlowUseCase.givenResult(A_HOMESERVER_CONFIG, StartAuthenticationResult(isHomeserverOutdated = false, resultingState))
633-
givenRegistrationResultFor(RegisterAction.StartRegistration, ANY_CONTINUING_REGISTRATION_RESULT)
633+
givenRegistrationResultFor(RegisterAction.StartRegistration, RegistrationActionHandler.Result.StartRegistration)
634634
fakeHomeServerHistoryService.expectUrlToBeAdded(A_HOMESERVER_CONFIG.homeServerUri.toString())
635635
}
636636

0 commit comments

Comments
 (0)