fix: add fallback for when crypto.randomUUID is unavailable

Closes #11452

Co-authored-by: Yo'av Moshe <bjesus@users.noreply.github.com>
This commit is contained in:
Adam 2026-02-09 06:35:53 -06:00
commit dd2d232a9d
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
const dataUrl = reader.result as string
const attachment: ImageAttachmentPart = {
type: "image",
id: crypto.randomUUID(),
id: crypto.randomUUID?.() ?? Math.random().toString(16).slice(2),
filename: file.name,
mime: file.type,
dataUrl,