Fix replaceState bug

This commit is contained in:
Lynn
2022-01-18 15:36:31 +01:00
parent f26abca2ec
commit 22e2b3866b

View File

@@ -66,7 +66,8 @@ function Game(props: GameProps) {
const [gameNumber, setGameNumber] = useState(1); const [gameNumber, setGameNumber] = useState(1);
const startNextGame = () => { const startNextGame = () => {
if (challenge) { if (challenge) {
window.history.replaceState("", "", "/"); // Clear the URL parameters:
window.history.replaceState({}, document.title, window.location.pathname);
} }
setChallenge(""); setChallenge("");
setTarget(randomTarget(wordLength)); setTarget(randomTarget(wordLength));