fix(app): guard randomUUID in insecure browser contexts (#13237)

Co-authored-by: Selim <31136147+selimerunkut@users.noreply.github.com>
This commit is contained in:
Adam
2026-02-11 19:05:15 -06:00
committed by GitHub
parent aea68c386a
commit 81ca2df6ad
5 changed files with 98 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import { createSimpleContext } from "@opencode-ai/ui/context"
import { useParams } from "@solidjs/router"
import { Persist, persisted } from "@/utils/persist"
import { createScopedCache } from "@/utils/scoped-cache"
import { uuid } from "@/utils/uuid"
import type { SelectedLineRange } from "@/context/file"
export type LineComment = {
@@ -53,7 +54,7 @@ function createCommentSessionState(store: Store<CommentStore>, setStore: SetStor
const add = (input: Omit<LineComment, "id" | "time">) => {
const next: LineComment = {
id: crypto.randomUUID?.() ?? Math.random().toString(16).slice(2),
id: uuid(),
time: Date.now(),
...input,
}