From f39d1a9ae9633d19ad33b933a8b63b83e43021bb Mon Sep 17 00:00:00 2001 From: io53 Date: Wed, 4 Dec 2024 23:58:49 +0200 Subject: [PATCH] fixed issue where compare page would not render all data #460 --- src/components/CompareView.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CompareView.jsx b/src/components/CompareView.jsx index e453a70..810f0b0 100644 --- a/src/components/CompareView.jsx +++ b/src/components/CompareView.jsx @@ -140,14 +140,16 @@ function CompareView(props) { props.isLoading(true) setSensorData([]) gdata = [] - let pd = [[], []]; for (const sensor of sensors) { let until = props.to let since = props.from; let allData = null; + let stop = false for (; ;) { - if (since >= until) break; + if (since >= until || stop) { + break; + } let data = await new NetworkApi().getAsync(sensor, since, until, { limit: pjson.settings.dataFetchPaginationSize }); if (data.result === "success") { if (!allData) allData = data; @@ -157,7 +159,7 @@ function CompareView(props) { if (data.data.nextUp) until = data.data.nextUp; else if (data.data.fromCache) until = data.data.measurements[data.data.measurements.length - 1].timestamp; else if (returndDataLength >= pjson.settings.dataFetchPaginationSize) until = data.data.measurements[data.data.measurements.length - 1].timestamp; - else break; + else stop = true let d = parse(allData.data); setSensorData((s) => {