mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: replace crypto.randomUUID with generateId in AI tool settings
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Download, Redo, Trash2 } from "lucide-react";
|
import { Download, Redo, Trash2 } from "lucide-react";
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { ProgressCard } from "@/components/common/progress-card";
|
import { ProgressCard } from "@/components/common/progress-card";
|
||||||
|
import { generateId } from "@/lib/utils";
|
||||||
import { useFileStore } from "@/stores/file-store";
|
import { useFileStore } from "@/stores/file-store";
|
||||||
import type { EraserCanvasRef } from "./eraser-canvas";
|
import type { EraserCanvasRef } from "./eraser-canvas";
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ export function EraseObjectSettings({
|
|||||||
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const clientJobId = crypto.randomUUID();
|
const clientJobId = generateId();
|
||||||
|
|
||||||
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);
|
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);
|
||||||
es.onmessage = (event) => {
|
es.onmessage = (event) => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Check, Copy } from "lucide-react";
|
import { Check, Copy } from "lucide-react";
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { ProgressCard } from "@/components/common/progress-card";
|
import { ProgressCard } from "@/components/common/progress-card";
|
||||||
|
import { generateId } from "@/lib/utils";
|
||||||
import { useFileStore } from "@/stores/file-store";
|
import { useFileStore } from "@/stores/file-store";
|
||||||
|
|
||||||
function getToken(): string {
|
function getToken(): string {
|
||||||
@@ -49,7 +50,7 @@ export function OcrSettings() {
|
|||||||
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const clientJobId = crypto.randomUUID();
|
const clientJobId = generateId();
|
||||||
|
|
||||||
// Open SSE for server-side progress
|
// Open SSE for server-side progress
|
||||||
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);
|
const es = new EventSource(`/api/v1/jobs/${clientJobId}/progress`);
|
||||||
|
|||||||
Reference in New Issue
Block a user