fix: ensure unique ID generation for ICalSubscription in useCalendarStore

This commit is contained in:
Linus Rath
2026-03-27 18:04:48 +01:00
parent 66cdfe64ce
commit 9b0598b051
+3 -1
View File
@@ -622,7 +622,9 @@ export const useCalendarStore = create<CalendarStore>()(
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,