Skip to content

Commit

Permalink
Unpack ternary.
Browse files Browse the repository at this point in the history
  • Loading branch information
codyml committed Jul 26, 2022
1 parent 1f69feb commit 5e3a927
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions superset-frontend/src/explore/components/ControlHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ const ControlHeader: FC<ControlHeaderProps> = ({
hasHadNoErrors.current = true;
}

return hasHadNoErrors.current
? validationErrors.length
? colors.error.base
: 'unset'
: colors.alert.base;
if (hasHadNoErrors.current) {
if (validationErrors.length) {
return colors.error.base;
}

return 'unset';
}

return colors.alert.base;
}, [colors.error.base, colors.alert.base, validationErrors.length]);

if (!label) {
Expand Down

0 comments on commit 5e3a927

Please sign in to comment.