1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

Bug fix - Hide case sensitive button when changing operators (#2015)

This commit is contained in:
andreas-unleash 2022-09-05 09:30:31 +03:00 committed by GitHub
parent 3331e2aa85
commit 5f3af07e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,8 +72,12 @@ export const ConstraintAccordionEditHeader = ({
oneOf(dateOperators, operator)
) {
setOperator(IN);
} else if (oneOf(stringOperators, operator)) {
}
if (oneOf(stringOperators, operator)) {
setShowCaseSensitiveButton(true);
} else {
setShowCaseSensitiveButton(false);
}
}, [contextName, setOperator, operator, setLocalConstraint]);
@ -86,6 +90,12 @@ export const ConstraintAccordionEditHeader = ({
});
const onOperatorChange = (operator: Operator) => {
if (oneOf(stringOperators, operator)) {
setShowCaseSensitiveButton(true);
} else {
setShowCaseSensitiveButton(false);
}
if (oneOf(dateOperators, operator)) {
setLocalConstraint(prev => ({
...prev,
@ -93,9 +103,6 @@ export const ConstraintAccordionEditHeader = ({
value: new Date().toISOString(),
}));
} else {
if (oneOf(stringOperators, operator)) {
setShowCaseSensitiveButton(true);
}
setOperator(operator);
}
};