mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Fixed realtime chart rendering of initial payload.
This commit is contained in:
parent
c520a329d2
commit
7a5f28870f
1 changed files with 12 additions and 8 deletions
|
|
@ -38,6 +38,9 @@ export function Realtime({ websiteId }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
if (!currentData) {
|
||||||
|
setCurrentData(data);
|
||||||
|
} else {
|
||||||
const date = subMinutes(startOfMinute(new Date()), REALTIME_RANGE);
|
const date = subMinutes(startOfMinute(new Date()), REALTIME_RANGE);
|
||||||
const time = date.getTime();
|
const time = date.getTime();
|
||||||
|
|
||||||
|
|
@ -48,6 +51,7 @@ export function Realtime({ websiteId }) {
|
||||||
timestamp: data.timestamp,
|
timestamp: data.timestamp,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const realtimeData: RealtimeData = useMemo(() => {
|
const realtimeData: RealtimeData = useMemo(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue