mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-30 02:30:57 +00:00
q renamed to search
This commit is contained in:
parent
e3811c91e2
commit
373e5b5d39
2 changed files with 4 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ const SearchBar = ({ className }) => {
|
|||
if (routeActive) {
|
||||
const { search: locationSearch } = UrlUtils.parse(locationHash.slice(1));
|
||||
const queryParams = new URLSearchParams(locationSearch);
|
||||
return queryParams.has('q') ? queryParams.get('q') : '';
|
||||
return queryParams.has('search') ? queryParams.get('search') : '';
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
@ -32,7 +32,7 @@ const SearchBar = ({ className }) => {
|
|||
}, [routeActive]);
|
||||
const queryInputOnSubmit = React.useCallback(() => {
|
||||
if (routeActive) {
|
||||
window.location.replace(`#/search?q=${searchInputRef.current.value}`);
|
||||
window.location.replace(`#/search?search=${searchInputRef.current.value}`);
|
||||
}
|
||||
}, [routeActive]);
|
||||
React.useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ const useSearch = (queryParams) => {
|
|||
setSearch(search);
|
||||
};
|
||||
core.on('NewModel', onNewState);
|
||||
if (queryParams.has('q')) {
|
||||
if (queryParams.has('search')) {
|
||||
core.dispatch({
|
||||
action: 'Load',
|
||||
args: {
|
||||
load: 'CatalogsGrouped',
|
||||
args: {
|
||||
extra: [
|
||||
['search', queryParams.get('q')]
|
||||
['search', queryParams.get('search')]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue