diff options
| author | Sanjit K <skomputeruser@gmail.com> | 2025-07-12 00:14:03 -0500 |
|---|---|---|
| committer | Sanjit K <skomputeruser@gmail.com> | 2025-07-12 00:14:03 -0500 |
| commit | 799fd2981abe010a5e4362b5c64951be5d0902c0 (patch) | |
| tree | f31d608bdbe681a7b0090929af4230aa94083049 /apps/web/src/stores/media-store.ts | |
| parent | fd017d6aca1a17edc4614b4bf07091eb41f8d310 (diff) | |
| download | opencut-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/media-store.ts')
| -rw-r--r-- | apps/web/src/stores/media-store.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/web/src/stores/media-store.ts b/apps/web/src/stores/media-store.ts index 76cdd638..dc9ad90d 100644 --- a/apps/web/src/stores/media-store.ts +++ b/apps/web/src/stores/media-store.ts @@ -1,6 +1,7 @@ import { create } from "zustand"; import { storageService } from "@/lib/storage/storage-service"; import { useTimelineStore } from "./timeline-store"; +import { generateUUID } from "@/lib/utils"; export type MediaType = "image" | "video" | "audio"; @@ -161,7 +162,7 @@ export const useMediaStore = create<MediaStore>((set, get) => ({ addMediaItem: async (projectId, item) => { const newItem: MediaItem = { ...item, - id: crypto.randomUUID(), + id: generateUUID(), }; // Add to local state immediately for UI responsiveness |
