Skip to content

Commit

Permalink
fix(client): handle quiz exit on i18n clients (freeCodeCamp#58323)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojeytonwilliams authored Jan 23, 2025
1 parent 635dc09 commit 9acc877
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/templates/Challenges/quiz/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]);

Expand Down

0 comments on commit 9acc877

Please sign in to comment.