mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(client): handle quiz exit on i18n clients (#58323)
This commit is contained in:
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user