fix(client): handle quiz exit on i18n clients (#58323)

This commit is contained in:
Oliver Eyton-Williams
2025-01-23 20:49:52 +01:00
committed by GitHub
parent 635dc099a0
commit 9acc877bd9
@@ -7,7 +7,7 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import type { Dispatch } from 'redux';
import { createSelector } from 'reselect';
import { useLocation } from '@reach/router';
import { useLocation, navigate as reachNavigate } from '@reach/router';
import {
Container,
Col,
@@ -252,7 +252,9 @@ const ShowQuiz = ({
return;
}
void navigate(`${curLocation.pathname}`);
// We need to use Reach Router, because the pathname is already prefixed
// with the language and Gatsby's navigate will prefix it again.
void reachNavigate(`${curLocation.pathname}`);
openExitQuizModal();
}, [curLocation.pathname, hasSubmitted, exitConfirmed, openExitQuizModal]);