Skip to content

Commit

Permalink
Remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
viown committed Nov 28, 2024
1 parent 9e4e3b0 commit 63834e1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/apps/dashboard/routes/users/parentalcontrol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,11 @@ const UserParentalControl = () => {
populateRatings(allParentalRatings);

let ratingValue = '';
if (user.Policy?.MaxParentalRating != null) {
allParentalRatings.forEach(rating => {
if (rating.Value != null && user.Policy?.MaxParentalRating != null && user.Policy.MaxParentalRating >= rating.Value) {
ratingValue = `${rating.Value}`;
}
});
}
allParentalRatings.forEach(rating => {
if (rating.Value != null && user.Policy?.MaxParentalRating != null && user.Policy.MaxParentalRating >= rating.Value) {
ratingValue = `${rating.Value}`;
}
});

setMaxParentalRating(ratingValue);

Expand Down

0 comments on commit 63834e1

Please sign in to comment.