mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fixed visitor calculation.
This commit is contained in:
parent
802c262cd9
commit
8ecc6400ef
@ -33,9 +33,16 @@ export default function RealtimeChart({ data, unit, ...props }) {
|
||||
return { pageviews: [], sessions: [] };
|
||||
}
|
||||
|
||||
const visitors = data.sessions?.reduce((arr, val) => {
|
||||
if (!arr.find(({ sessionId }) => sessionId === val.sessionId)) {
|
||||
return arr.concat(val);
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
|
||||
return {
|
||||
pageviews: getDateArray(mapData(data.pageviews), startDate, endDate, unit),
|
||||
sessions: getDateArray(mapData(data.sessions), startDate, endDate, unit),
|
||||
sessions: getDateArray(mapData(visitors), startDate, endDate, unit),
|
||||
};
|
||||
}, [data, startDate, endDate, unit]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user