Rename isFetchingSearchResults to showSearchLoader
This commit is contained in:
parent
a0ba83c863
commit
44b6a97c90
14 changed files with 50 additions and 50 deletions
|
|
@ -47,7 +47,7 @@ class MatrixUserRepository @Inject constructor(
|
|||
null
|
||||
}
|
||||
if (shouldQueryProfile || shouldFetchSearchResults) {
|
||||
emit(UserSearchResultState(isFetchingSearchResults = shouldFetchSearchResults, results = listOfNotNull(fakeSearchResult)))
|
||||
emit(UserSearchResultState(isSearching = shouldFetchSearchResults, results = listOfNotNull(fakeSearchResult)))
|
||||
}
|
||||
if (shouldFetchSearchResults) {
|
||||
val results = fetchSearchResults(query, shouldQueryProfile)
|
||||
|
|
@ -73,7 +73,7 @@ class MatrixUserRepository @Inject constructor(
|
|||
?: UserSearchResult(MatrixUser(UserId(query)), isUnresolved = true))
|
||||
}
|
||||
|
||||
return UserSearchResultState(results = results, isFetchingSearchResults = false)
|
||||
return UserSearchResultState(results = results, isSearching = false)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ internal class MatrixUserRepositoryTest {
|
|||
|
||||
result.test {
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isTrue()
|
||||
assertThat(it.isSearching).isTrue()
|
||||
assertThat(it.results).isEmpty()
|
||||
}
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isFalse()
|
||||
assertThat(it.isSearching).isFalse()
|
||||
assertThat(it.results).isEmpty()
|
||||
}
|
||||
awaitComplete()
|
||||
|
|
@ -76,11 +76,11 @@ internal class MatrixUserRepositoryTest {
|
|||
|
||||
result.test {
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isTrue()
|
||||
assertThat(it.isSearching).isTrue()
|
||||
assertThat(it.results).isEmpty()
|
||||
}
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isFalse()
|
||||
assertThat(it.isSearching).isFalse()
|
||||
assertThat(it.results).isEqualTo(aMatrixUserList().toUserSearchResults())
|
||||
}
|
||||
awaitComplete()
|
||||
|
|
@ -96,7 +96,7 @@ internal class MatrixUserRepositoryTest {
|
|||
|
||||
result.test {
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isTrue()
|
||||
assertThat(it.isSearching).isTrue()
|
||||
assertThat(it.results).isEqualTo(listOf(placeholderResult()))
|
||||
}
|
||||
cancelAndConsumeRemainingEvents()
|
||||
|
|
@ -112,7 +112,7 @@ internal class MatrixUserRepositoryTest {
|
|||
|
||||
result.test {
|
||||
awaitItem().also {
|
||||
assertThat(it.isFetchingSearchResults).isTrue()
|
||||
assertThat(it.isSearching).isTrue()
|
||||
assertThat(it.results).isEmpty()
|
||||
}
|
||||
cancelAndConsumeRemainingEvents()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue