fix(settings): use randomUUID helper with getRandomValues fallback for non-secure contexts

This commit is contained in:
xintaofei
2026-04-18 18:25:28 +08:00
parent ff48810603
commit 75c2dd4cc5
2 changed files with 7 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ import {
opencodeUninstallPlugin,
} from "@/lib/api"
import { usePluginInstallStream } from "@/hooks/use-plugin-install-stream"
import { randomUUID } from "@/lib/utils"
import type { PluginCheckSummary, PluginInfo } from "@/lib/types"
interface OpencodePluginsModalProps {
@@ -74,7 +75,7 @@ export function OpencodePluginsModal({
}, [stream.status])
const handleInstallAll = useCallback(async () => {
const taskId = crypto.randomUUID()
const taskId = randomUUID()
await stream.start(taskId)
try {
await opencodeInstallPlugins(taskId)
@@ -85,7 +86,7 @@ export function OpencodePluginsModal({
const handleInstallOne = useCallback(
async (name: string) => {
const taskId = crypto.randomUUID()
const taskId = randomUUID()
await stream.start(taskId)
try {
await opencodeInstallPlugins(taskId, [name])