Skip to content

Commit

Permalink
[Discover] Improve time range text loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed Nov 4, 2022
1 parent f7384af commit af9a681
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/plugins/unified_histogram/public/chart/use_time_range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export const useTimeRange = ({
);

const timeRangeText = useMemo(() => {
if (!bucketInterval) {
return '';
}

const timeRange = {
from: dateMath.parse(from),
to: dateMath.parse(to, { roundUp: true }),
Expand All @@ -60,7 +56,12 @@ export const useTimeRange = ({
defaultMessage: 'Auto',
})} - `
: ''
}${bucketInterval.description}`,
}${
bucketInterval?.description ??
i18n.translate('unifiedHistogram.histogramTimeRangeIntervalLoading', {
defaultMessage: 'loading...',
})
}`,
},
});

Expand Down

0 comments on commit af9a681

Please sign in to comment.