Skip to content

Commit

Permalink
fix the fix with matchPath (sigh)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZekeAranyLucas committed Nov 28, 2023
1 parent ee540a5 commit 58e8d0d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions client/src/components/ProjectWizard/TdmCalculationWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@ const TdmCalculationWizard = props => {
*/
const calculationPath = "/calculation/:page/:projectId?/*";
const isSameProject = (currentLocation, nextLocation) => {
const currentMatch = matchPath(currentLocation.pathname, {
path: calculationPath,
exact: true
});
const nextMatch = matchPath(nextLocation.pathname, {
path: calculationPath,
exact: true
});
const currentMatch = matchPath(
{
path: calculationPath,
exact: true
},
currentLocation.pathname
);
const nextMatch = matchPath(
{
path: calculationPath,
exact: true
},
nextLocation.pathname
);
return (
currentMatch &&
nextMatch &&
Expand Down

0 comments on commit 58e8d0d

Please sign in to comment.