From 125d00926f36211e4140b2b94c5befc86a716005 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Mon, 12 Feb 2024 11:39:12 -0500 Subject: [PATCH] LabelTab: guard clause for pipelineRange, both start_ts and end_ts --- www/js/diary/LabelTab.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/js/diary/LabelTab.tsx b/www/js/diary/LabelTab.tsx index 8cbe7e24b..c740a9afc 100644 --- a/www/js/diary/LabelTab.tsx +++ b/www/js/diary/LabelTab.tsx @@ -186,7 +186,8 @@ const LabelTab = () => { async function loadAnotherWeek(when: 'past' | 'future') { try { logDebug('LabelTab: loadAnotherWeek into the ' + when); - if (!pipelineRange?.start_ts) return logWarn('No pipelineRange yet - early return'); + if (!pipelineRange?.start_ts || !pipelineRange?.end_ts) + return logWarn('No pipelineRange yet - early return'); const reachedPipelineStart = queriedRange?.start_ts && queriedRange.start_ts <= pipelineRange.start_ts; @@ -265,7 +266,8 @@ const LabelTab = () => { } async function fetchTripsInRange(startTs: number, endTs: number) { - if (!pipelineRange?.start_ts) return logWarn('No pipelineRange yet - early return'); + if (!pipelineRange?.start_ts || !pipelineRange?.end_ts) + return logWarn('No pipelineRange yet - early return'); logDebug('LabelTab: fetchTripsInRange from ' + startTs + ' to ' + endTs); const readCompositePromise = readAllCompositeTrips(startTs, endTs); let readUnprocessedPromise;