From 5886af74395e3679ac2b68499acd1c3dfa2211cd Mon Sep 17 00:00:00 2001 From: amarouane-ABDELHAK Date: Wed, 27 Sep 2023 09:19:01 -0500 Subject: [PATCH 1/3] Temporary fox of critical error encoutered during demos --- app/scripts/components/common/page-header.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/scripts/components/common/page-header.tsx b/app/scripts/components/common/page-header.tsx index 8274d3176..c458708e9 100644 --- a/app/scripts/components/common/page-header.tsx +++ b/app/scripts/components/common/page-header.tsx @@ -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; @@ -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 ( From 586e5adadf71ca3e7a8bb33da0eee140cc7ac147 Mon Sep 17 00:00:00 2001 From: Hanbyul Jo Date: Wed, 27 Sep 2023 17:30:56 -0400 Subject: [PATCH 2/3] Use as 'a' --- app/scripts/components/common/page-header.tsx | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/app/scripts/components/common/page-header.tsx b/app/scripts/components/common/page-header.tsx index c458708e9..f9937dfc8 100644 --- a/app/scripts/components/common/page-header.tsx +++ b/app/scripts/components/common/page-header.tsx @@ -60,11 +60,6 @@ const PageHeaderSelf = styled.header` } `; -const force_reload = (current_path) => { - - window.location.replace(current_path) -}; - const Brand = styled.div` display: flex; flex-shrink: 0; @@ -348,18 +343,8 @@ function PageHeader() { }, [isMediumDown]); 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 ( @@ -414,7 +399,8 @@ function PageHeader() {
  • Data Catalog @@ -422,14 +408,19 @@ function PageHeader() {
  • Data Analysis
  • - + {getString('stories').other}
  • From 51219d8cc4e40fb47bd312b18e5612b7a3b01242 Mon Sep 17 00:00:00 2001 From: Hanbyul Jo Date: Wed, 27 Sep 2023 17:39:32 -0400 Subject: [PATCH 3/3] Fix lint --- app/scripts/components/common/page-header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/components/common/page-header.tsx b/app/scripts/components/common/page-header.tsx index f9937dfc8..70ca2d0ed 100644 --- a/app/scripts/components/common/page-header.tsx +++ b/app/scripts/components/common/page-header.tsx @@ -342,7 +342,7 @@ function PageHeader() { if (!isMediumDown) setGlobalNavRevealed(false); }, [isMediumDown]); - const closeNavOnClick = useCallback((e) => { + const closeNavOnClick = useCallback(() => { setGlobalNavRevealed(false); }, []);