From 33b6a2012aadf67d3839e9f907652e16d186b492 Mon Sep 17 00:00:00 2001 From: goodmice Date: Mon, 7 Nov 2022 06:33:14 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=20=D0=BE=D1=87=D0=B8=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D0=B5=D0=BC=D0=B5=D1=82=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/index.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/Well/Telemetry/TelemetryView/index.jsx b/src/pages/Well/Telemetry/TelemetryView/index.jsx index b2c654f..0587474 100644 --- a/src/pages/Well/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/index.jsx @@ -156,14 +156,14 @@ const TelemetryView = memo(() => { const spinSubject$ = useMemo(() => new BehaviorSubject(), []) const handleDataSaub = useCallback((data, replace = false) => { - if (data) { + setDataSaub((prev) => { + if (!data) + return replace ? [] : prev const dataSaub = normalizeData(data) - setDataSaub((prev) => { - const out = replace ? [...dataSaub] : [...prev, ...dataSaub] - out.sort(dateSorter) - return out - }) - } + const out = replace ? [...dataSaub] : [...prev, ...dataSaub] + out.sort(dateSorter) + return out + }) }, []) const handleDataSpin = useCallback((data) => data && setDataSpin((prev) => [...prev, ...data]), [])