Skip to content

Commit

Permalink
delete modal from search when trying to close the practice questions
Browse files Browse the repository at this point in the history
  • Loading branch information
jivey committed Nov 13, 2024
1 parent 006fbba commit 8972892
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ const PracticeQuestionsPopup = () => {
if (!assertWindow().confirm(message)) { return; }
}

dispatch(push(assertDefined(match, 'match should be always defined at this step')));
const definedMatch = assertDefined(match, 'match should be always defined at this step');

if ('search' in definedMatch && typeof definedMatch.search === 'string') {
const params = new URLSearchParams(definedMatch.search);
params.delete('modal');
definedMatch.search = params.toString();
}

dispatch(push(definedMatch));

trackOpenClosePQ(method);
}, [currentQuestionIndex, trackOpenClosePQ, intl, dispatch, match]);
Expand Down

0 comments on commit 8972892

Please sign in to comment.