fix(studio): crypto.randomUUID crash on non-secure origins (http LAN IP)
Build now (and every studio/image editor id generation) called crypto.randomUUID, which is undefined outside a secure context — so over http://<LAN-IP> (used because localhost is VPN-hijacked) the click threw 'crypto.randomUUID is not a function' and the spinner hung forever, never reaching the editor. Add lib/uuid.ts (crypto.randomUUID → crypto.getRandomValues → Math.random fallback) and use it in studio-store, image-editor-store, project-defaults, dev-mock-project. Verified headless (Chrome over http://172.28.144.1): Build now → 201 → navigates to /studio/video/<id> → editor renders Scene 1 with editable title/subtitle fields. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,10 @@ import {
|
||||
captureSceneThumbnailFromStage,
|
||||
scheduleSceneThumbnailCapture,
|
||||
} from "@/lib/studio-scene-thumbnail";
|
||||
import { uuid } from "@/lib/uuid";
|
||||
|
||||
function createId(): string {
|
||||
return crypto.randomUUID();
|
||||
return uuid();
|
||||
}
|
||||
|
||||
function defaultPropsForType(type: LayerType): LayerProps {
|
||||
|
||||
Reference in New Issue
Block a user