Skip to content

Commit 9c1e2ab

Browse files
use recommended does not affect disabled switcher (#940)
1 parent 23eb87f commit 9c1e2ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

redisinsight/ui/src/components/consents-settings/ConsentsSettings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ const ConsentsSettings = ({ onSubmitted }: Props) => {
8686
if (e.target.checked) {
8787
const newBufferValues:Values = {}
8888
consents.forEach((consent) => {
89-
if (!consent.required) {
89+
if (!consent.required && !consent.disabled) {
9090
newBufferValues[consent.agreementName] = formik.values[consent.agreementName]
9191
formik.setFieldValue(consent.agreementName, true)
9292
}
9393
setValuesBuffer(newBufferValues)
9494
})
9595
} else {
9696
consents.forEach((consent) => {
97-
if (!consent.required) {
97+
if (!consent.required && !consent.disabled) {
9898
formik.setFieldValue(consent.agreementName, valuesBuffer[consent.agreementName])
9999
}
100100
})
@@ -153,14 +153,14 @@ const ConsentsSettings = ({ onSubmitted }: Props) => {
153153
const checkIsRecommended = () => {
154154
let recommended = true
155155
forEach(privacyConsents, (consent) => {
156-
if (!formik.values[consent?.agreementName]) {
156+
if (!formik.values[consent?.agreementName] && !consent.disabled) {
157157
recommended = false
158158
return false
159159
}
160160
})
161161

162162
forEach(notificationConsents, (consent) => {
163-
if (!formik.values[consent?.agreementName]) {
163+
if (!formik.values[consent?.agreementName] && !consent.disabled) {
164164
recommended = false
165165
return false
166166
}

0 commit comments

Comments
 (0)