mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Add validation for start and end date in MetricView to prevent loading without valid dates
This commit is contained in:
parent
a98fc6f784
commit
ae002c0d88
@ -396,6 +396,14 @@ const MetricView: FunctionComponent<ComponentProps> = (
|
|||||||
async (): Promise<void> => {
|
async (): Promise<void> => {
|
||||||
setIsMetricResultsLoading(true);
|
setIsMetricResultsLoading(true);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!metricViewData.startAndEndDate?.startValue ||
|
||||||
|
!metricViewData.startAndEndDate?.endValue
|
||||||
|
) {
|
||||||
|
setIsMetricResultsLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const results: Array<AggregatedResult> = [];
|
const results: Array<AggregatedResult> = [];
|
||||||
try {
|
try {
|
||||||
for (const queryConfig of metricViewData.queryConfigs) {
|
for (const queryConfig of metricViewData.queryConfigs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user