From 2b5dbaa318a7768d4a7246993f46545760341505 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 20 Jun 2024 14:33:32 +0200 Subject: [PATCH] fix first session --- dashboard/server/api/metrics/[project_id]/counts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/server/api/metrics/[project_id]/counts.ts b/dashboard/server/api/metrics/[project_id]/counts.ts index 7964f5c..b1d1311 100644 --- a/dashboard/server/api/metrics/[project_id]/counts.ts +++ b/dashboard/server/api/metrics/[project_id]/counts.ts @@ -63,7 +63,7 @@ export default defineEventHandler(async event => { return { eventsCount: count[0].events, visitsCount: count[0].visits, - sessionsVisitsCount: totalSessions + (sessionsVisitsCount?.[0]?.count || 0), + sessionsVisitsCount: totalSessions || 0, avgSessionDuration, firstEventDate, firstViewDate,