Skip to content

Commit

Permalink
Fix issue with double slashes causing crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corofides committed Nov 8, 2023
1 parent 614c207 commit 9f52ec1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Hooks/usePages/usePages.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ const usePages = () => {
// Todo Revisit this as I don't like the way it works.
const getCurrentPage = (route) => {



const page = pages.find(({location}) => {

const pagePattern = new UrlPattern(location);
return pagePattern.match(route) !== null;
return pagePattern.match(route.replace('//', '/')) !== null;

});

Expand Down

0 comments on commit 9f52ec1

Please sign in to comment.