Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Oct 30, 2020
1 parent 2815ca3 commit d7be45e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ export const MetricExpression = ({
);

const expressionDisplayValue = useMemo(
() =>
(customMetricTabOpen
() => {
return customMetricTabOpen
? customMetric?.field && getCustomMetricLabel(customMetric)
: metric?.text) || firstFieldOption.text,
[customMetricTabOpen, metric?.text, customMetric?.field, firstFieldOption]
: metric?.text || firstFieldOption.text;
},
// The ?s are confusing eslint here, so...
// eslint-disable-next-line react-hooks/exhaustive-deps
[customMetricTabOpen, metric, customMetric, firstFieldOption]
);

const onChangeTab = useCallback(
Expand Down Expand Up @@ -163,7 +166,7 @@ export const MetricExpression = ({
};
if (SnapshotCustomMetricInputRT.is(newCustomMetric)) debouncedOnChangeCustom(newCustomMetric);
},
[customMetric, onChangeCustom]
[customMetric, debouncedOnChangeCustom]
);

const availablefieldsOptions = metrics.map((m) => {
Expand Down

0 comments on commit d7be45e

Please sign in to comment.