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(() => {