mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-02-14 13:29:25 -06:00
Added fix to searching for admin role
This commit is contained in:
@@ -51,9 +51,9 @@ function NavBar() {
|
||||
const authState = useSelector((state) => state.auth);
|
||||
|
||||
let settings = ["Profile", "Password", "Team", "Logout"];
|
||||
if (authState.user.role[0] !== "admin")
|
||||
if (!authState.user.role.includes("admin"))
|
||||
settings = ["Profile", "Password", "Logout"];
|
||||
|
||||
|
||||
/**
|
||||
* Handles opening the user menu.
|
||||
*
|
||||
|
||||
@@ -26,7 +26,7 @@ const Account = ({ open = "profile" }) => {
|
||||
|
||||
let tabList = ["Profile", "Password", "Team"];
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
if (user.role[0] !== "admin") tabList = ["Profile", "Password"];
|
||||
if (!user.role.includes("admin")) tabList = ["Profile", "Password"];
|
||||
|
||||
return (
|
||||
<Box
|
||||
@@ -74,7 +74,7 @@ const Account = ({ open = "profile" }) => {
|
||||
</Box>
|
||||
<ProfilePanel />
|
||||
<PasswordPanel />
|
||||
{ user.role[0] === "admin" && <TeamPanel />}
|
||||
{ user.role.includes("admin") && <TeamPanel />}
|
||||
</TabContext>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user