diff --git a/src/components/Dashboard/Dashboard.js b/src/components/Dashboard/Dashboard.js index 2223ab8..bf0f32d 100644 --- a/src/components/Dashboard/Dashboard.js +++ b/src/components/Dashboard/Dashboard.js @@ -37,6 +37,7 @@ function Dashboard() { const handleClose = () => { setSignup(false); }; + let [logoutUser, setLogout] = useState(false); @@ -46,7 +47,15 @@ function Dashboard() { let [major, setMajor] = useState(""); - + console.log(user) + useEffect(() => { + console.log(logoutUser) + if (user == null && logoutUser) { + navigate("/"); + setLogout(false); + } + + }, [user]); // const items2 = [ @@ -98,7 +107,9 @@ function Dashboard() { let [nodes, setNodes] = useState({}); let [edges, setEdges] = useState({}); let [tab, setTab] = useState(0); - let [signup, setSignup] = useState(true); + + let [signup, setSignup] = useState(false); + let [colorSchema, setColorSchema] = useState("tot"); @@ -365,13 +376,15 @@ function Dashboard() { try { RequestUtils.get('/retrieve?id=' + user.uid).then((response) => response.json()) .then((data) => { - console.log(data) + console.log(data.status) if (data.status == 200) { setFirst(data.data.name); setLast(data.data.last); setYear(data.data.year); setMajor(data.data.major); - } else { + } + if(data.status == 404) { + console.log(data.status) setSignup(true); } }); @@ -466,7 +479,9 @@ function Dashboard() { label: "Logout", onClick: () => { logout(); - navigate("/"); + setLogout(true); + + } } diff --git a/src/components/Table/Table.jsx b/src/components/Table/Table.jsx index 26c3ae9..39d8451 100644 --- a/src/components/Table/Table.jsx +++ b/src/components/Table/Table.jsx @@ -77,30 +77,26 @@ const EditableCell = ({ } return