summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/project-store.ts
diff options
context:
space:
mode:
authorSanjit K <skomputeruser@gmail.com>2025-07-12 00:14:03 -0500
committerSanjit K <skomputeruser@gmail.com>2025-07-12 00:14:03 -0500
commit799fd2981abe010a5e4362b5c64951be5d0902c0 (patch)
treef31d608bdbe681a7b0090929af4230aa94083049 /apps/web/src/stores/project-store.ts
parentfd017d6aca1a17edc4614b4bf07091eb41f8d310 (diff)
downloadopencut-799fd2981abe010a5e4362b5c64951be5d0902c0.tar.gz
fixed: [BUG] crypto.randomUUID is not a function Runtime Error #205. Added fallback function with manual UUID generation if crypto.randomUUID() was not available.
Diffstat (limited to 'apps/web/src/stores/project-store.ts')
-rw-r--r--apps/web/src/stores/project-store.ts5
1 files changed, 3 insertions, 2 deletions
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<ProjectStore>((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<ProjectStore>((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(),