Skip to content

Commit

Permalink
lol no optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar committed Aug 20, 2024
1 parent 844ad9b commit f3e4a8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/user-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const useStyles = makeStyles(theme => ({

function UserInfo(props = {}) {
const [userState] = useUserState();
const { userId = userState.user?.steamid } = props;
const userIdFromState = userState.user ? userState.user.steamid : null;
const { userId = userIdFromState } = props;
const classes = useStyles();
const [userProfile, setUserProfile] = useState(props.userProfile || null);
const { user } = userState;
Expand Down

0 comments on commit f3e4a8f

Please sign in to comment.