Skip to content

Commit

Permalink
fix RowyRunModal causing crash for user with no roles
Browse files Browse the repository at this point in the history
  • Loading branch information
notsidney committed Apr 8, 2022
1 parent 1745097 commit 06f4bf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/RowyRunModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { WIKI_LINKS } from "@src/constants/externalLinks";
import { useProjectContext } from "@src/contexts/ProjectContext";

export default function RowyRunModal() {
const { userClaims } = useAppContext();
const { userRoles } = useAppContext();
const { settings } = useProjectContext();

const [state, setState] = useAtom(rowyRunModalAtom);
Expand Down Expand Up @@ -79,12 +79,12 @@ export default function RowyRunModal() {
size="large"
onClick={handleClose}
style={{ display: "flex" }}
disabled={!userClaims?.roles.includes("ADMIN")}
disabled={!userRoles.includes("ADMIN")}
>
Set up Rowy Run
</Button>

{!userClaims?.roles.includes("ADMIN") && (
{!userRoles.includes("ADMIN") && (
<Typography
variant="body2"
textAlign="center"
Expand Down

0 comments on commit 06f4bf8

Please sign in to comment.