fix: replace crypto.randomUUID with generateId in AI tool settings

This commit is contained in:
Siddharth Kumar Sah
2026-04-04 16:30:44 +08:00
parent 7a5a753a2d
commit 659081c568
2 changed files with 4 additions and 2 deletions
@@ -1,6 +1,7 @@
import { Download, Redo, Trash2 } from "lucide-react";
import { useRef, useState } from "react";
import { ProgressCard } from "@/components/common/progress-card";
import { generateId } from "@/lib/utils";
import { useFileStore } from "@/stores/file-store";
import type { EraserCanvasRef } from "./eraser-canvas";
@@ -49,7 +50,7 @@ export function EraseObjectSettings({
setElapsed(Math.floor((Date.now() - startTime) / 1000));
}, 1000);
const clientJobId = crypto.randomUUID();
const clientJobId = generateId();
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);
es.onmessage = (event) => {
@@ -1,6 +1,7 @@
import { Check, Copy } from "lucide-react";
import { useRef, useState } from "react";
import { ProgressCard } from "@/components/common/progress-card";
import { generateId } from "@/lib/utils";
import { useFileStore } from "@/stores/file-store";
function getToken(): string {
@@ -49,7 +50,7 @@ export function OcrSettings() {
setElapsed(Math.floor((Date.now() - startTime) / 1000));
}, 1000);
const clientJobId = crypto.randomUUID();
const clientJobId = generateId();
// Open SSE for server-side progress
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);