mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
fix: metaDetails redirect when route ends with /
Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
parent
cf73c7942d
commit
ea69521912
1 changed files with 5 additions and 1 deletions
|
|
@ -81,7 +81,11 @@ const MetaDetails = ({ urlParams, queryParams }) => {
|
|||
const handleEpisodeSearch = React.useCallback((season, episode) => {
|
||||
const searchVideoHash = encodeURIComponent(`${urlParams.id}:${season}:${episode}`);
|
||||
const url = window.location.hash;
|
||||
const searchVideoPath = url.replace(encodeURIComponent(urlParams.videoId), searchVideoHash);
|
||||
|
||||
const searchVideoPath = (urlParams.videoId === undefined || urlParams.videoId === null || urlParams.videoId === '') ?
|
||||
url + (!url.endsWith('/') ? '/' : '') + searchVideoHash
|
||||
: url.replace(encodeURIComponent(urlParams.videoId), searchVideoHash);
|
||||
|
||||
window.location = searchVideoPath;
|
||||
}, [urlParams, window.location]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue