From 097336851391b57a1c4314f51e16376cd4ab0ddd Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 7 Aug 2018 01:37:18 -0400 Subject: [PATCH] add isBackgroundSearch param to doSearch function --- src/redux/actions/search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/redux/actions/search.js b/src/redux/actions/search.js index 8e79a51..cf87fd5 100644 --- a/src/redux/actions/search.js +++ b/src/redux/actions/search.js @@ -13,7 +13,8 @@ const DEFAULTSEARCHRESULTFROM = 0; export const doSearch = ( rawQuery, size = DEFAULTSEARCHRESULTSIZE, - from = DEFAULTSEARCHRESULTFROM + from = DEFAULTSEARCHRESULTFROM, + isBackgroundSearch ) => (dispatch, getState) => { const state = getState(); const query = rawQuery.replace(/^lbry:\/\//i, ''); @@ -38,7 +39,8 @@ export const doSearch = ( // If the user is on the file page with a pre-populated uri and they select // the search option without typing anything, searchQuery will be empty // We need to populate it so the input is filled on the search page - if (!state.search.searchQuery) { + // isBackgroundSearch means the search is happening in the background, don't update the search query + if (!state.search.searchQuery && !isBackgroundSearch) { dispatch({ type: ACTIONS.UPDATE_SEARCH_QUERY, data: { searchQuery: query },