refactor(ControlBar): use replace method instead of href

This commit is contained in:
Tim 2022-11-02 16:54:56 +01:00
parent 205f3c605a
commit 49cf06a8c2

View file

@ -55,9 +55,9 @@ const ControlBar = ({
const onNextVideoButtonClick = React.useCallback(() => {
if (nextVideo !== null && typeof nextVideo.deepLinks === 'object') {
if (nextVideo.deepLinks.player !== null) {
window.location.href = nextVideo.deepLinks.player;
window.location.replace(nextVideo.deepLinks.player);
} else if (nextVideo.deepLinks.metaDetailsStreams !== null) {
window.location.href = nextVideo.deepLinks.metaDetailsStreams;
window.location.replace(nextVideo.deepLinks.metaDetailsStreams);
}
}
}, [nextVideo]);