mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Fixed realtime logs.
This commit is contained in:
parent
8ecc6400ef
commit
7d3334ccce
7 changed files with 88 additions and 108 deletions
|
|
@ -58,7 +58,7 @@ export default function RealtimeDashboard({ websiteId }) {
|
|||
|
||||
const realtimeData = useMemo(() => {
|
||||
if (!currentData) {
|
||||
return { pageviews: [], sessions: [], events: [], countries: [] };
|
||||
return { pageviews: [], sessions: [], events: [], countries: [], visitors: [] };
|
||||
}
|
||||
|
||||
currentData.countries = percentFilter(
|
||||
|
|
@ -84,6 +84,13 @@ export default function RealtimeDashboard({ websiteId }) {
|
|||
.sort(firstBy('y', -1)),
|
||||
);
|
||||
|
||||
currentData.visitors = currentData.sessions.reduce((arr, val) => {
|
||||
if (!arr.find(({ sessionId }) => sessionId === val.sessionId)) {
|
||||
return arr.concat(val);
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
|
||||
return currentData;
|
||||
}, [currentData]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue