mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
fix(studio,producer): post-merge regressions and open issues (#1643)
- fix gsapDragCommit.test.ts import for commitGsapPositionFromDrag - add generateId() helper with insecure-context fallback (fixes #1637) - enable STUDIO_KEYFRAMES_ENABLED by default - prevent clock duration from shrinking during playback (fixes #1636) - add maxRetries to rmSync cleanup calls to handle ENOTEMPTY race (fixes #1644)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// ponytail: crypto.randomUUID is undefined on plain HTTP non-localhost origins
|
||||
export function generateId(): string {
|
||||
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
return `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { generateId } from "./generateId";
|
||||
|
||||
// PostHog public ingest key — write-only, safe to ship in the client bundle
|
||||
const POSTHOG_API_KEY = "phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx";
|
||||
const POSTHOG_HOST = "https://us.i.posthog.com";
|
||||
@@ -29,7 +31,7 @@ function getDistinctId(): string {
|
||||
} catch {
|
||||
// localStorage may be unavailable
|
||||
}
|
||||
distinctId = crypto.randomUUID();
|
||||
distinctId = generateId();
|
||||
try {
|
||||
localStorage.setItem("hf-studio-anon-id", distinctId);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user