From 7d04a98f683efab51d84d3d667a60045c42b157c Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Sat, 6 Jan 2024 14:39:57 -0300 Subject: [PATCH] Fixed button inside button on sidebar --- src/frontend/src/contexts/authContext.tsx | 4 +-- src/frontend/src/modals/exportModal/index.tsx | 2 +- .../extraSidebarComponent/index.tsx | 36 +++++++++++++------ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/contexts/authContext.tsx b/src/frontend/src/contexts/authContext.tsx index ee2a0c35c..e00ac93b6 100644 --- a/src/frontend/src/contexts/authContext.tsx +++ b/src/frontend/src/contexts/authContext.tsx @@ -34,8 +34,8 @@ export function AuthProvider({ children }): React.ReactElement { cookies.get("refresh_tkn_lflw") ); const [isAuthenticated, setIsAuthenticated] = useState( - cookies.get("refresh_tkn_lflw") && cookies.get("access_tkn_lflw") - ); + !!cookies.get("refresh_tkn_lflw") && !!cookies.get("access_tkn_lflw") + ); const [isAdmin, setIsAdmin] = useState(false); const [userData, setUserData] = useState(null); const [autoLogin, setAutoLogin] = useState(false); diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index 358f5225c..658e523fb 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -26,7 +26,7 @@ const ExportModal = forwardRef( return ( - {props.children} + {props.children} Export state.data); @@ -229,11 +229,9 @@ export default function ExtraSidebar(): JSX.Element { const ExportMemo = useMemo( () => ( - - - + ), [] @@ -274,7 +272,15 @@ export default function ExtraSidebar(): JSX.Element { - {(!hasApiKey || !validApiKey) && ExportMemo} + {(!hasApiKey || !validApiKey) && ( + +
{ExportMemo}
+
+ )}
{currentFlow && currentFlow.data && ( @@ -305,7 +311,17 @@ export default function ExtraSidebar(): JSX.Element { (isPending ? "" : "button-disable") } onClick={(event) => { - saveFlow({...currentFlow, data: {nodes, edges, viewport: reactFlowInstance?.getViewport()!} }, true); + saveFlow( + { + ...currentFlow, + data: { + nodes, + edges, + viewport: reactFlowInstance?.getViewport()!, + }, + }, + true + ); }} >