diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx index 31bd32c..b7812e8 100644 --- a/client/src/pages/VideoPage.tsx +++ b/client/src/pages/VideoPage.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; import { useQuery } from "@tanstack/react-query"; -import { useRoute } from "wouter"; +import { useRoute, useLocation } from "wouter"; import { type Video } from "@shared/schema"; import go4LogoPath from "@assets/go4_1756394900352.png"; @@ -52,6 +52,7 @@ interface VideosResponse { export default function VideoPage() { const [, params] = useRoute("/video/:id"); + const [, setLocation] = useLocation(); const videoId = params?.id; const [showShareMenu, setShowShareMenu] = useState(false); const [touchStart, setTouchStart] = useState(0); @@ -96,7 +97,7 @@ export default function VideoPage() { const newVideo = allVideos[newIndex]; if (newVideo) { - window.location.href = `/video/${newVideo.id}`; + setLocation(`/video/${newVideo.id}`); } };