From 4501a40c29f1d8389a705699f50bee02fc931740 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:48:01 +0100 Subject: [PATCH] fix header and redirect home --- apps/client/src/App.tsx | 4 ++-- apps/client/src/components/layouts/global/top-menu.tsx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/client/src/App.tsx b/apps/client/src/App.tsx index e9ea50c..307e60f 100644 --- a/apps/client/src/App.tsx +++ b/apps/client/src/App.tsx @@ -1,4 +1,4 @@ -import { Route, Routes } from "react-router-dom"; +import { Navigate, Route, Routes } from "react-router-dom"; import { Welcome } from "@/pages/welcome"; import SignUpPage from "@/pages/auth/signup"; import LoginPage from "@/pages/auth/login"; @@ -59,7 +59,7 @@ export default function App() { return ( <> - } /> + } /> } /> } /> } /> diff --git a/apps/client/src/components/layouts/global/top-menu.tsx b/apps/client/src/components/layouts/global/top-menu.tsx index 5d3ea7e..5eade7d 100644 --- a/apps/client/src/components/layouts/global/top-menu.tsx +++ b/apps/client/src/components/layouts/global/top-menu.tsx @@ -20,6 +20,10 @@ export default function TopMenu() { const user = currentUser.user; const workspace = currentUser.workspace; + if (!user || !workspace) { + return <>; + } + return (