Skip to content

Commit

Permalink
add redirect to browse challenge page when task doesnt exist (#2554)
Browse files Browse the repository at this point in the history
* add redirect to browse challenge page when task doesnt exist

* remove debugger
  • Loading branch information
CollinBeczak authored Feb 18, 2025
1 parent 12cef90 commit 06025b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/HOCs/WithCurrentTask/WithCurrentTask.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export const mapDispatchToProps = (dispatch, ownProps) => {
normalizedResults?.entities?.tasks?.[normalizedResults.result]?.deleted
) {
dispatch(addError(AppErrors.task.doesNotExist));
ownProps.history.push("/browse/challenges");
if (ownProps.match.params.challengeId) {
ownProps.history.push(`/browse/challenges/${ownProps.match.params.challengeId}`);
} else {
ownProps.history.push("/browse/challenges");
}
return;
}

Expand Down

0 comments on commit 06025b8

Please sign in to comment.