From 799fd2981abe010a5e4362b5c64951be5d0902c0 Mon Sep 17 00:00:00 2001 From: Sanjit K Date: Sat, 12 Jul 2025 00:14:03 -0500 Subject: fixed: [BUG] crypto.randomUUID is not a function Runtime Error #205. Added fallback function with manual UUID generation if crypto.randomUUID() was not available. --- apps/web/src/stores/project-store.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/web/src/stores/project-store.ts') diff --git a/apps/web/src/stores/project-store.ts b/apps/web/src/stores/project-store.ts index 913c6810..e1a4a72e 100644 --- a/apps/web/src/stores/project-store.ts +++ b/apps/web/src/stores/project-store.ts @@ -4,6 +4,7 @@ import { storageService } from "@/lib/storage/storage-service"; import { toast } from "sonner"; import { useMediaStore } from "./media-store"; import { useTimelineStore } from "./timeline-store"; +import { generateUUID } from "@/lib/utils"; interface ProjectStore { activeProject: TProject | null; @@ -35,7 +36,7 @@ export const useProjectStore = create((set, get) => ({ createNewProject: async (name: string) => { const newProject: TProject = { - id: crypto.randomUUID(), + id: generateUUID(), name, thumbnail: "", createdAt: new Date(), @@ -223,7 +224,7 @@ export const useProjectStore = create((set, get) => ({ existingNumbers.length > 0 ? Math.max(...existingNumbers) + 1 : 1; const newProject: TProject = { - id: crypto.randomUUID(), + id: generateUUID(), name: `(${nextNumber}) ${baseName}`, thumbnail: project.thumbnail, createdAt: new Date(), -- cgit v1.3.1