Skip to content

Commit b322150

Browse files
committed
fix: crypto not found error
1 parent f194668 commit b322150

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

frontend/src/context/CommandManager.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export class CommandManager {
7979
}
8080

8181
private generateCommandId(): string {
82-
return crypto.randomUUID(); // if supported
82+
return typeof crypto !== "undefined" && crypto.randomUUID
83+
? crypto.randomUUID()
84+
: (Date.now() + Math.random()).toString(36);
8385
// Or fallback: return (Date.now() + Math.random()).toString(36);
8486
}
8587
}

0 commit comments

Comments
 (0)