diff --git a/src/js/components/SearchResults.js b/src/js/components/SearchResults.js
index d1ef8cb4d..308c56528 100755
--- a/src/js/components/SearchResults.js
+++ b/src/js/components/SearchResults.js
@@ -9,6 +9,7 @@ import { Grid } from './Grid';
import { I18n } from '../locale';
import Button from './Button';
import { makeSearchResultsSelector, getSortSelector } from '../util/selectors';
+import useSearchQuery from '../util/useSearchQuery';
const SORT_KEY = 'search_results';
@@ -16,14 +17,13 @@ const SearchResults = ({
type,
all,
}) => {
- const { term, providers = '' } = useParams();
+ const { term, providers } = useSearchQuery();
+ const encodedProviders = providers.join(',').replace(/:/g,'');
const [sortField, sortReverse] = useSelector(
(state) => getSortSelector(state, SORT_KEY, 'name'),
);
- const providersArray = providers.split(',');
- const searchResultsSelector = makeSearchResultsSelector(providersArray, term, type);
+ const searchResultsSelector = makeSearchResultsSelector(providers, term, type);
const rawResults = useSelector(searchResultsSelector);
- console.debug(rawResults, providersArray, term, type)
const encodedTerm = encodeURIComponent(term);
let results = [...rawResults];
@@ -45,7 +45,7 @@ const SearchResults = ({
{!all && (
-
+
{' '}
@@ -55,7 +55,7 @@ const SearchResults = ({
)}
{all && (
-
+
)}
@@ -68,7 +68,7 @@ const SearchResults = ({
{type === 'tracks' && (
*/}
{resultsCount > results.length && (
-