From 9b0598b051489518c23ca4772ecf0064f942437c Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:04:48 +0100 Subject: [PATCH] fix: ensure unique ID generation for ICalSubscription in useCalendarStore --- stores/calendar-store.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stores/calendar-store.ts b/stores/calendar-store.ts index d05edc5e..33942a4e 100644 --- a/stores/calendar-store.ts +++ b/stores/calendar-store.ts @@ -622,7 +622,9 @@ export const useCalendarStore = create()( if (!calendar) throw new Error('Failed to create calendar'); const subscription: ICalSubscription = { - id: crypto.randomUUID(), + id: typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function' + ? crypto.randomUUID() + : `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`, url, calendarId: calendar.id, name,