Search: Get uris with same query as doSearch

## Issue
2731: Searches with forward slashes returns no results

## Change
The slash-removal came from (0db20834f9).

Removing the 2 `replace(/\//, ' ')` from lbry-desktop fixes it, but this PR assumes the slash-removal is intentional to cover something else. So, we'll make the Search side do the same thing to match what's happening in `doSearch`.

A little bit ugly, but there's already a comment about this in `makeSelectSearchUris`, so it'll probably get cleaned up in the future.
This commit is contained in:
infiinte-persistence 2021-02-01 12:33:46 +08:00 committed by Sean Yesmunt
parent d78d965183
commit 64874c773b

View file

@ -16,7 +16,11 @@ import SearchPage from './view';
const select = (state, props) => {
const showMature = makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state);
const urlParams = new URLSearchParams(props.location.search);
const urlQuery = urlParams.get('q') || null;
let urlQuery = urlParams.get('q') || null;
if (urlQuery) {
urlQuery = urlQuery.replace(/^lbry:\/\//i, '').replace(/\//, ' ');
}
const query = makeSelectQueryWithOptions(
urlQuery,
showMature === false ? { nsfw: false, isBackgroundSearch: false } : { isBackgroundSearch: false }