For #1620: Hide search results when they match URL
parent
22eb207cef
commit
19a2d9df4f
|
@ -166,9 +166,18 @@ class AwesomeBarView(
|
|||
fun update(state: SearchFragmentState) {
|
||||
view.removeAllProviders()
|
||||
|
||||
// Do not make suggestions based on user's current URL
|
||||
if (state.query == state.session?.url) {
|
||||
return
|
||||
}
|
||||
|
||||
// Only show the shortcutEnginePicker by itself
|
||||
if (state.showSearchShortcuts) {
|
||||
view.addProviders(shortcutsEnginePickerProvider)
|
||||
} else {
|
||||
view.onInputChanged(state.query)
|
||||
return
|
||||
}
|
||||
|
||||
if (state.showSearchSuggestions) {
|
||||
view.addProviders(
|
||||
when (state.searchEngineSource) {
|
||||
|
@ -191,7 +200,6 @@ class AwesomeBarView(
|
|||
if ((container.context.asActivity() as? HomeActivity)?.browsingModeManager?.mode?.isPrivate == false) {
|
||||
view.addProviders(sessionProvider)
|
||||
}
|
||||
}
|
||||
|
||||
view.onInputChanged(state.query)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue