1
0
Fork 0

No issue: clarify naming for showing a prompt to allow search suggestions (#7870)

master
Severin Rudie 2020-01-22 19:08:07 -08:00 committed by GitHub
parent a39a9e5b4e
commit 44e4d8e12c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ class DefaultSearchController(
)
)
store.dispatch(
SearchFragmentAction.ShowSearchSuggestionsHint(
SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(
text.isNotEmpty() &&
(context as HomeActivity).browsingModeManager.mode.isPrivate &&
!context.settings().shouldShowSearchSuggestionsInPrivate &&

View File

@ -70,7 +70,7 @@ sealed class SearchFragmentAction : Action {
data class SearchShortcutEngineSelected(val engine: SearchEngine) : SearchFragmentAction()
data class SelectNewDefaultSearchEngine(val engine: SearchEngine) : SearchFragmentAction()
data class ShowSearchShortcutEnginePicker(val show: Boolean) : SearchFragmentAction()
data class ShowSearchSuggestionsHint(val show: Boolean) : SearchFragmentAction()
data class AllowSearchSuggestionsInPrivateModePrompt(val show: Boolean) : SearchFragmentAction()
data class UpdateQuery(val query: String) : SearchFragmentAction()
}
@ -92,7 +92,7 @@ private fun searchStateReducer(state: SearchFragmentState, action: SearchFragmen
state.copy(
searchEngineSource = SearchEngineSource.Default(action.engine)
)
is SearchFragmentAction.ShowSearchSuggestionsHint ->
is SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt ->
state.copy(showSearchSuggestionsHint = action.show)
is SearchFragmentAction.UpdateEditingCanceled ->
state.copy(isAnimatingOut = true)

View File

@ -123,7 +123,7 @@ class SearchInteractorTest {
interactor.onTextChanged("test")
verify { store.dispatch(SearchFragmentAction.UpdateQuery("test")) }
verify { store.dispatch(SearchFragmentAction.ShowSearchSuggestionsHint(false)) }
verify { store.dispatch(SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(false)) }
}
@Test