Skip to content

Commit

Permalink
LabelTab: guard clause for pipelineRange, both start_ts and end_ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JGreenlee committed Feb 12, 2024
1 parent 633db15 commit 125d009
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions www/js/diary/LabelTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 125d009

Please sign in to comment.