mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 03:22:11 +00:00
queryParams fixed
This commit is contained in:
parent
d96573b8d9
commit
e204b2f7f0
1 changed files with 2 additions and 3 deletions
|
|
@ -12,16 +12,15 @@ const useSelectedAddon = (transportUrl) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(transportUrl) // todo
|
fetch(transportUrl) // TODO
|
||||||
.then((resp) => resp.json())
|
.then((resp) => resp.json())
|
||||||
.then((manifest) => setAddon({ manifest, transportUrl, flags: {} }));
|
.then((manifest) => setAddon({ manifest, transportUrl, flags: {} }));
|
||||||
}, [transportUrl]);
|
}, [transportUrl]);
|
||||||
const clear = React.useCallback(() => {
|
const clear = React.useCallback(() => {
|
||||||
if (active) {
|
if (active) {
|
||||||
const { pathname, search } = UrlUtils.parse(locationHash.slice(1));
|
const { pathname, search } = UrlUtils.parse(locationHash.slice(1));
|
||||||
const queryParams = new URLSearchParams(search);
|
const queryParams = new URLSearchParams(search || '');
|
||||||
queryParams.delete('addon');
|
queryParams.delete('addon');
|
||||||
queryParams.delete('null');
|
|
||||||
if ([...queryParams].length !== 0) {
|
if ([...queryParams].length !== 0) {
|
||||||
window.location.replace(`#${pathname}?${queryParams.toString()}`);
|
window.location.replace(`#${pathname}?${queryParams.toString()}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue