Always let the user try what they have entered, to get an explicit error if they continue
This commit is contained in:
parent
c397c8e2c3
commit
bb93d6ff06
2 changed files with 11 additions and 4 deletions
|
|
@ -52,9 +52,10 @@ class HomeserverResolver(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If list is empty, and the user has entered an URL, do not block the user.
|
// If list is empty, and candidateBase is a valid an URL, do not block the user.
|
||||||
if (currentList.isEmpty() && trimmedUserInput.isValidUrl()) {
|
// A unsupported homeserver / homeserver not found error will be displayed if the user continues
|
||||||
emit(listOf(HomeserverData(homeserverUrl = trimmedUserInput)))
|
if (currentList.isEmpty() && candidateBase.isValidUrl()) {
|
||||||
|
emit(listOf(HomeserverData(homeserverUrl = candidateBase)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,13 @@ class SearchAccountProviderPresenterTest {
|
||||||
assertThat(withInputState.userInput).isEqualTo("test")
|
assertThat(withInputState.userInput).isEqualTo("test")
|
||||||
assertThat(initialState.userInputResult).isEqualTo(AsyncData.Uninitialized)
|
assertThat(initialState.userInputResult).isEqualTo(AsyncData.Uninitialized)
|
||||||
assertThat(awaitItem().userInputResult).isInstanceOf(AsyncData.Loading::class.java)
|
assertThat(awaitItem().userInputResult).isInstanceOf(AsyncData.Loading::class.java)
|
||||||
assertThat(awaitItem().userInputResult).isEqualTo(AsyncData.Uninitialized)
|
assertThat(awaitItem().userInputResult).isEqualTo(
|
||||||
|
AsyncData.Success(
|
||||||
|
listOf(
|
||||||
|
aHomeserverData(homeserverUrl = "https://test"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue