From 7f1796c11655c700063641ede047ef821030d0a5 Mon Sep 17 00:00:00 2001 From: Await-0x <146035814+Await-0x@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:29:45 +0100 Subject: [PATCH] update url when ending replay --- client/src/contexts/replayContext.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/contexts/replayContext.jsx b/client/src/contexts/replayContext.jsx index 6da642c..704de9d 100644 --- a/client/src/contexts/replayContext.jsx +++ b/client/src/contexts/replayContext.jsx @@ -11,6 +11,7 @@ import { generateMapNodes } from '../helpers/map'; import { BattleContext } from './battleContext'; import { DraftContext } from './draftContext'; import { GAME_STATES, GameContext } from './gameContext'; +import { useNavigate } from "react-router-dom"; // Create a context const ReplayContext = createContext(); @@ -22,6 +23,7 @@ export const ReplayProvider = ({ children }) => { const battle = useContext(BattleContext) const { enqueueSnackbar } = useSnackbar() + const navigate = useNavigate() const [toriiClient, setToriiClient] = useState(null) let provider = new RpcProvider({ nodeUrl: dojoConfig.rpcUrl }); @@ -87,6 +89,8 @@ export const ReplayProvider = ({ children }) => { battle.utils.resetBattleState() game.endGame() + + navigate('/') } const nextStep = async () => {