From 00074e039e70b7b8f1d7262f6a1dcd5ac1d3026c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 6 Sep 2024 12:01:58 -0700 Subject: [PATCH] Simplify tab check --- Client/src/Pages/Account/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Client/src/Pages/Account/index.jsx b/Client/src/Pages/Account/index.jsx index eda4d96d8..391d3adc9 100644 --- a/Client/src/Pages/Account/index.jsx +++ b/Client/src/Pages/Account/index.jsx @@ -24,18 +24,18 @@ const Account = ({ open = "profile" }) => { }; const { user } = useSelector((state) => state.auth); - let tabList = ["Profile", "Team", "Password"]; - - // Remove passwrod for demo - if (user.role.includes("demo")) { - tabList = tabList.filter((tab) => tab !== "Password"); - } const requiredRoles = ["superadmin", "admin"]; + let tabList = ["Profile", "Team", "Password"]; const hideTeams = !requiredRoles.some((role) => user.role.includes(role)); if (hideTeams) { tabList = ["Profile", "Password"]; } + // Remove passwrod for demo + if (user.role.includes("demo")) { + tabList = ["Profile"]; + } + return (