Make ChangeServerPresenter.submit fail as expected (#236)
* Make `ChangeServerPresenter.submit` fail as expected * Fix tests to prevent this from ever happening again
This commit is contained in:
parent
fc73b2b8f9
commit
76ade37355
3 changed files with 6 additions and 10 deletions
|
|
@ -69,7 +69,7 @@ class ChangeServerPresenter @Inject constructor(private val authenticationServic
|
|||
private fun CoroutineScope.submit(homeserverUrl: MutableState<String>, changeServerAction: MutableState<Async<Unit>>) = launch {
|
||||
suspend {
|
||||
val domain = tryOrNull { URL(homeserverUrl.value) }?.host ?: homeserverUrl.value
|
||||
authenticationService.setHomeserver(domain)
|
||||
authenticationService.setHomeserver(domain).getOrThrow()
|
||||
homeserverUrl.value = domain
|
||||
}.execute(changeServerAction, errorMapping = ChangeServerError::from)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue