ui: check period start/end to prevent useless calculations
This commit is contained in:
parent
c55b1971c4
commit
6bd5b60b1e
2 changed files with 7 additions and 2 deletions
|
|
@ -197,10 +197,10 @@ function WidgetChart(props: Props) {
|
|||
if (!inView || !props.isPreview) return;
|
||||
loadComparisonData();
|
||||
}, [
|
||||
dashboardStore.comparisonPeriods[_metric.metricId],
|
||||
_metric.metricId,
|
||||
inView,
|
||||
props.isPreview,
|
||||
dashboardStore.comparisonPeriods[_metric.metricId],
|
||||
_metric.metricId,
|
||||
drillDownPeriod,
|
||||
period,
|
||||
depsString,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ function WidgetDateRange({
|
|||
};
|
||||
|
||||
const onChangeComparison = (period: any) => {
|
||||
if (compPeriod) {
|
||||
if (compPeriod.start === period.start && compPeriod.end === period.end) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
dashboardStore.setComparisonPeriod(period, metricStore.instance.metricId);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue