From 95cfc930486480e04327e29bf10bcdefae76eaec Mon Sep 17 00:00:00 2001 From: goodmice Date: Mon, 15 Nov 2021 12:52:02 +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=D0=BD=D0=BE=D1=80=D0=BC=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Archive/index.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/Archive/index.jsx b/src/pages/Archive/index.jsx index da660f4..f22a53b 100644 --- a/src/pages/Archive/index.jsx +++ b/src/pages/Archive/index.jsx @@ -7,6 +7,7 @@ import LoaderPortal from '../../components/LoaderPortal' import { Flex } from '../../components/Grid' import { PeriodPicker, defaultPeriod } from '../../components/PeriodPicker' import { ArchiveDisplay, cutData } from './ArchiveDisplay' +import { normalizeData, sortByDate } from '../TelemetryView' const DATA_COUNT = 2048 // Колличество точек на подгрузку графика const ADDITIVE_PAGES = 2 // Дополнительные данные для графиков @@ -103,8 +104,8 @@ export default function Archive({idWell}) { if (data) { data.forEach(elm => elm.date = new Date(elm.date)) setDataSaub((prevDataSaub) => { - const newData = [...prevDataSaub, ...data] - newData.sort((a, b) => a.date > b.date ? 1 : -1) + const newData = [...prevDataSaub, ...normalizeData(data)] + newData.sort(sortByDate) return cutData(newData, loadedStartDate, loadedEndDate) }) }