always batch resolve search results

This commit is contained in:
Sean Yesmunt 2020-08-12 13:02:19 -04:00
parent 2db2b870ff
commit abbaa8bf78

View file

@ -1,6 +1,6 @@
// @flow
import * as ACTIONS from 'constants/action_types';
import { buildURI, doResolveUri, batchActions } from 'lbry-redux';
import { buildURI, doResolveUris, batchActions } from 'lbry-redux';
import {
makeSelectSearchUris,
selectSuggestions,
@ -20,7 +20,6 @@ type SearchOptions = {
related_to?: string,
nsfw?: boolean,
isBackgroundSearch?: boolean,
resolveResults?: boolean,
};
// We can't use env's because they aren't passed into node_modules
@ -84,7 +83,6 @@ export const doSearch = (rawQuery: string, searchOptions: SearchOptions) => (
getState: GetState
) => {
const query = rawQuery.replace(/^lbry:\/\//i, '').replace(/\//, ' ');
const resolveResults = searchOptions && searchOptions.resolveResults;
const isBackgroundSearch = (searchOptions && searchOptions.isBackgroundSearch) || false;
if (!query) {
@ -136,13 +134,12 @@ export const doSearch = (rawQuery: string, searchOptions: SearchOptions) => (
}
const url = buildURI(urlObj);
if (resolveResults) {
actions.push(doResolveUri(url));
}
uris.push(url);
}
});
actions.push(doResolveUris(uris));
actions.push({
type: ACTIONS.SEARCH_SUCCESS,
data: {