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) }) }