Added fix to searching for admin role

This commit is contained in:
Daniel Cojocea committed 2024-07-24 15:07:00 -04:00
1 parent a10b831744
commit e2b5ad2524
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ function NavBar() {
const authState = useSelector((state) => state.auth); const authState = useSelector((state) => state.auth);
let settings = ["Profile", "Password", "Team", "Logout"]; let settings = ["Profile", "Password", "Team", "Logout"];
if (authState.user.role[0] !== "admin") if (!authState.user.role.includes("admin"))
settings = ["Profile", "Password", "Logout"]; settings = ["Profile", "Password", "Logout"];
/** /**
+2 -2
View File
@@ -26,7 +26,7 @@ const Account = ({ open = "profile" }) => {
let tabList = ["Profile", "Password", "Team"]; let tabList = ["Profile", "Password", "Team"];
const { user } = useSelector((state) => state.auth); const { user } = useSelector((state) => state.auth);
if (user.role[0] !== "admin") tabList = ["Profile", "Password"]; if (!user.role.includes("admin")) tabList = ["Profile", "Password"];
return ( return (
<Box <Box
@@ -74,7 +74,7 @@ const Account = ({ open = "profile" }) => {
</Box> </Box>
<ProfilePanel /> <ProfilePanel />
<PasswordPanel /> <PasswordPanel />
{ user.role[0] === "admin" && <TeamPanel />} { user.role.includes("admin") && <TeamPanel />}
</TabContext> </TabContext>
</Box> </Box>
); );