Set exemplars to falsee if they are disabled

This commit is contained in:
Ivana 2021-09-29 12:29:41 +02:00
parent 8a530ab5b5
commit e7b697c9f3

View File

@ -25,6 +25,13 @@ export function PromExemplarField({ datasource, onChange, isEnabled, refId }: Pr
};
}, [datasource, refId]);
// If exemplars are disabled, set them to false
useEffect(() => {
if (error) {
onChange(false);
}
}, [error, onChange]);
const iconButtonStyles = cx(
{
[styles.activeIcon]: isEnabled,