Доработано очищение графика телеметрии

This commit is contained in:
goodmice 2022-11-07 06:33:14 +05:00
parent bf2d6d6d36
commit 33b6a2012a
No known key found for this signature in database
GPG Key ID: 63EA771203189CF1

View File

@ -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]), [])