Skip to content

Commit 70c7383

Browse files
committed
Only attempt to load approval stats if the current user can view review assignments.
1 parent 982e422 commit 70c7383

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web-ui/src/components/reviews/periods/ReviewPeriodCard.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import {
2626
selectCurrentMembers,
2727
selectHasUpdateReviewAssignmentsPermission,
2828
selectReviewPeriod,
29-
selectReviewPeriods
29+
selectReviewPeriods,
30+
selectHasViewReviewAssignmentsPermission,
3031
} from '../../../context/selectors';
3132
import { titleCase } from '../../../helpers/strings.js';
3233

@@ -77,6 +78,10 @@ const ReviewPeriodCard = ({ mode, onSelect, periodId, selfReviews }) => {
7778
const handleExpandClick = () => setExpanded(!expanded);
7879

7980
const loadApprovalStats = async () => {
81+
if (!selectHasViewReviewAssignmentsPermission(state)) {
82+
return;
83+
}
84+
8085
// Get all the review assignments for this period.
8186
const res = await resolve({
8287
method: 'GET',

0 commit comments

Comments
 (0)