Skip to content

Commit

Permalink
update url when ending replay
Browse files Browse the repository at this point in the history
  • Loading branch information
Await-0x committed Mar 4, 2025
1 parent ab8290c commit 7f1796c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/contexts/replayContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 });
Expand Down Expand Up @@ -87,6 +89,8 @@ export const ReplayProvider = ({ children }) => {

battle.utils.resetBattleState()
game.endGame()

navigate('/')
}

const nextStep = async () => {
Expand Down

0 comments on commit 7f1796c

Please sign in to comment.