Skip to content
Snippets Groups Projects
Commit 4ddce1db authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Fix redirect to null user

Change-Id: I165af0a0854991f0a8d7c9168691049cb6e05268
parent 76928a3c
No related branches found
No related tags found
No related merge requests found
import React from "react";
import { useHistory } from "react-router-dom";
// core components
import Devices from "components/Devices/Devices.js";
......@@ -18,6 +19,8 @@ import DisplayUserProfile from "./DisplayUserProfile";
import i18next from "i18next";
import auth from "auth.js";
function TabPanel(props) {
const { children, value, index, ...other } = props;
......@@ -52,6 +55,7 @@ function a11yProps(index) {
}
export default function UserProfile(props) {
const history = useHistory();
const [value, setValue] = React.useState(0);
const [displayUser, setDisplayUser] = React.useState(true);
......@@ -60,7 +64,11 @@ export default function UserProfile(props) {
setValue(newValue);
};
React.useEffect(() => {}, []);
React.useEffect(() => {
if(props.username === "null") {
history.push("/");
}
}, []);
return (
<div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment