Skip to content

Commit

Permalink
Temporary fox of critical error encoutered during demos
Browse files Browse the repository at this point in the history
  • Loading branch information
amarouane-ABDELHAK committed Sep 27, 2023
1 parent b7feda8 commit 5886af7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion app/scripts/components/common/page-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ const PageHeaderSelf = styled.header`
}
`;

const force_reload = (current_path) => {

window.location.replace(current_path)
};

const Brand = styled.div`
display: flex;
flex-shrink: 0;
Expand Down Expand Up @@ -342,7 +347,19 @@ function PageHeader() {
if (!isMediumDown) setGlobalNavRevealed(false);
}, [isMediumDown]);

const closeNavOnClick = useCallback(() => setGlobalNavRevealed(false), []);
const closeNavOnClick = useCallback((e) => {


setGlobalNavRevealed(false);

// Need a time out for the event to register the current path
setTimeout(() => {
let current_path = e.target.baseURI;
force_reload(current_path)

}, 120);

}, []);

return (
<PageHeaderSelf id={HEADER_ID}>
Expand Down

0 comments on commit 5886af7

Please sign in to comment.