forked from ddrilling/asb_cloud_front
Доработано очищение графика телеметрии
This commit is contained in:
parent
9c85b1e229
commit
f82b80d0d0
@ -157,14 +157,14 @@ const TelemetryView = memo(() => {
|
|||||||
const spinSubject$ = useMemo(() => new BehaviorSubject(), [])
|
const spinSubject$ = useMemo(() => new BehaviorSubject(), [])
|
||||||
|
|
||||||
const handleDataSaub = useCallback((data, replace = false) => {
|
const handleDataSaub = useCallback((data, replace = false) => {
|
||||||
if (data) {
|
setDataSaub((prev) => {
|
||||||
|
if (!data)
|
||||||
|
return replace ? [] : prev
|
||||||
const dataSaub = normalizeData(data)
|
const dataSaub = normalizeData(data)
|
||||||
setDataSaub((prev) => {
|
const out = replace ? [...dataSaub] : [...prev, ...dataSaub]
|
||||||
const out = replace ? [...dataSaub] : [...prev, ...dataSaub]
|
out.sort(dateSorter)
|
||||||
out.sort(dateSorter)
|
return out
|
||||||
return out
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const handleDataSpin = useCallback((data) => data && setDataSpin((prev) => [...prev, ...data]), [])
|
const handleDataSpin = useCallback((data) => data && setDataSpin((prev) => [...prev, ...data]), [])
|
||||||
|
Loading…
Reference in New Issue
Block a user