Исправлена ошибка при попытке получения границ данных по скважине без них

This commit is contained in:
goodmice 2021-11-23 15:43:49 +05:00
parent 29ce0d781b
commit 9a4f048ad2

View File

@ -105,7 +105,8 @@ export default function Archive({idWell}) {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const dates = await TelemetryDataSaubService.getDataDatesRange(idWell)
let dates = await TelemetryDataSaubService.getDataDatesRange(idWell)
if (!dates) dates = {}
dates.from = new Date(dates.from ?? (Date.now() - chartInterval))
dates.to = new Date(dates.to ?? Date.now())
const startDate = new Date(Math.max(dates.from, +dates.to - chartInterval))