mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Fixed visitor calculation.
This commit is contained in:
parent
802c262cd9
commit
8ecc6400ef
1 changed files with 8 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue