From bd81aa040124c957517963f22ec4416dbd3e15e5 Mon Sep 17 00:00:00 2001 From: goodmice Date: Mon, 21 Nov 2022 10:40:27 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=82=D0=B5=D0=BB=D0=B5=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Well/Telemetry/TelemetryView/archive_methods.js | 2 +- src/pages/Well/Telemetry/TelemetryView/index.jsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/Well/Telemetry/TelemetryView/archive_methods.js b/src/pages/Well/Telemetry/TelemetryView/archive_methods.js index ef3dc7c..2e488d1 100644 --- a/src/pages/Well/Telemetry/TelemetryView/archive_methods.js +++ b/src/pages/Well/Telemetry/TelemetryView/archive_methods.js @@ -21,7 +21,7 @@ export const getLoadingInterval = (loaded, endDate, interval) => { end: loadingEndDate } - if (loaded && (loaded.start ?? null) !== null && (loaded.end ?? null) !== null) { + if (loadingStartDate <= loaded?.end && loadingEndDate >= loaded.start) { if (loadingStartDate >= loaded.start) loadingStartDate = loaded.end if (loadingEndDate <= loaded.end) loadingEndDate = loaded.start newLoaded.start = Math.min(loaded.start, loadingStartDate) diff --git a/src/pages/Well/Telemetry/TelemetryView/index.jsx b/src/pages/Well/Telemetry/TelemetryView/index.jsx index 4aa0c8a..ea26a6d 100644 --- a/src/pages/Well/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/index.jsx @@ -72,8 +72,6 @@ const makeSubjectSubsription = (subject$, handler) => { return () => subscribtion.unsubscribe() } -const getRowDate = (row) => (row && isRawDate(row.date)) ? +new Date(row.date) : null - const TelemetryView = memo(() => { const [well, updateWell] = useWell() const [searchParams, setSearchParams] = useSearchParams() @@ -85,7 +83,7 @@ const TelemetryView = memo(() => { const [rop, setRop] = useState(null) const [chartMethods, setChartMethods] = useState() - const [loadedDataRange, setLoadedDataRange] = useState({}) + const [loadedDataRange, setLoadedDataRange] = useState(null) const [chartInterval, setChartInterval] = useState(defaultPeriod * 1000) const [endDate, setEndDate] = useState(defaultDate) const [dateLimit, setDateLimit] = useState({ from: 0, to: Date.now() }) @@ -249,6 +247,8 @@ const TelemetryView = memo(() => { setEndDate(new Date(saubLast.date)) }, [archiveMode, saubLast]) + const filteredData = useMemo(() => cutData(dataSaub, domain.min, domain.max), [dataSaub, domain]) + return (
@@ -305,7 +305,7 @@ const TelemetryView = memo(() => {