From a4d441e133cff3c44ced718775248ecca2fe51d2 Mon Sep 17 00:00:00 2001 From: arun s Date: Tue, 31 Dec 2024 09:29:00 +0530 Subject: [PATCH] FWF-4136 [Bugfix] Sidebar issue fixes with multi env (#2467) * FWF-4136 [Bugfix] Sidebar issue fixes with multi env * FWF-4136 [Bugfix] SOnarcloud fixes --- forms-flow-web/src/components/App.jsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/forms-flow-web/src/components/App.jsx b/forms-flow-web/src/components/App.jsx index 26b1ba62f..944580d54 100644 --- a/forms-flow-web/src/components/App.jsx +++ b/forms-flow-web/src/components/App.jsx @@ -17,10 +17,17 @@ import { HelperServices } from '@formsflow/service'; const App = React.memo((props) => { const { store, history, publish, subscribe, getKcInstance } = props; const [isPreviewRoute,setIsPreviewRoute] = useState(false); - useEffect(()=> { - const location = window.location.pathname; - setIsPreviewRoute(() => HelperServices.hideSideBarRoute(location)); - },[]); + + useEffect(() => { + props.subscribe("ES_ROUTE", (msg,data) => { + if (data) { + const location = data.pathname; + if(location) + setIsPreviewRoute(() => HelperServices.hideSideBarRoute(location)); + } + }); + }, []); + return (
@@ -45,6 +52,7 @@ const App = React.memo((props) => { App.propTypes = { history: PropTypes.any.isRequired, store: PropTypes.any.isRequired, + subscribe: PropTypes.func, }; export default App;