From 63834e164aae447bb41ecde992edab6a1b91cc59 Mon Sep 17 00:00:00 2001 From: viown <48097677+viown@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:48:26 +0300 Subject: [PATCH] Remove redundant check --- src/apps/dashboard/routes/users/parentalcontrol.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/apps/dashboard/routes/users/parentalcontrol.tsx b/src/apps/dashboard/routes/users/parentalcontrol.tsx index 539e813d6a..73abd265c0 100644 --- a/src/apps/dashboard/routes/users/parentalcontrol.tsx +++ b/src/apps/dashboard/routes/users/parentalcontrol.tsx @@ -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);