From dc4f0fd4c16a71ba80687581d97f35884dfc92d4 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sat, 14 Jan 2017 00:16:29 -0500 Subject: [PATCH] Fix search suggestions Follow up to b1bbeffc316ff6a2faa4271972e3015f72c2b2c9 Auditors: @bsclifton --- app/renderer/reducers/urlBarSuggestionsReducer.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/renderer/reducers/urlBarSuggestionsReducer.js b/app/renderer/reducers/urlBarSuggestionsReducer.js index 831455a2855..3cb3f173170 100644 --- a/app/renderer/reducers/urlBarSuggestionsReducer.js +++ b/app/renderer/reducers/urlBarSuggestionsReducer.js @@ -124,8 +124,8 @@ const generateNewSuggestionsList = (state) => { const activeFrameKey = state.get('activeFrameKey') const urlLocation = state.getIn(activeFrameStatePath(state).concat(['navbar', 'urlbar', 'location'])) const sites = appStoreRenderer.state.get('sites') - const searchResults = activeFrameStatePath(state).concat(['navbar', 'urlbar', 'suggestions', 'searchResults']) - const frameSearchDetail = activeFrameStatePath(state).concat(['navbar', 'urlbar', 'searchDetail']) + const searchResults = state.getIn(activeFrameStatePath(state).concat(['navbar', 'urlbar', 'suggestions', 'searchResults'])) + const frameSearchDetail = state.getIn(activeFrameStatePath(state).concat(['navbar', 'urlbar', 'searchDetail'])) const searchDetail = state.get('searchDetail') if (!urlLocation) { @@ -137,7 +137,9 @@ const generateNewSuggestionsList = (state) => { const defaultme = (x) => x const mapListToElements = ({data, maxResults, type, clickHandler = navigateSiteClickHandler.bind(this), sortHandler = defaultme, formatTitle = defaultme, formatUrl = defaultme, - filterValue = (site) => site.toLowerCase().includes(urlLocationLower) + filterValue = (site) => { + return site.toLowerCase().includes(urlLocationLower) + } }) => // Filter out things which are already in our own list at a smaller index data // Per suggestion provider filter