ensure sessions are never undefined

This commit is contained in:
Nikita Galaiko 2023-04-03 14:05:30 +02:00
parent 422eb18f1b
commit 5426f1db1d

View File

@ -15,6 +15,7 @@
const { activity, project, statuses, sessions, head } = data;
const recentSessions = derived(sessions, (sessions) => {
sessions ||= [];
const lastFourDaysOfSessions = sessions.filter(
(session) => session.meta.startTimestampMs >= getTime(subDays(new Date(), 4))
);