fix: replace crypto.randomUUID with generateId in pipeline/automation

This commit is contained in:
Siddharth Kumar Sah
2026-04-04 16:31:35 +08:00
parent 659081c568
commit b650dcd791
2 changed files with 4 additions and 3 deletions
@@ -16,7 +16,7 @@ import {
import { type SetStateAction, useCallback, useEffect, useMemo, useState } from "react"; import { type SetStateAction, useCallback, useEffect, useMemo, useState } from "react";
import { SearchBar } from "@/components/common/search-bar"; import { SearchBar } from "@/components/common/search-bar";
import { apiGet } from "@/lib/api"; import { apiGet } from "@/lib/api";
import { cn } from "@/lib/utils"; import { cn, generateId } from "@/lib/utils";
import { PipelineStepSettings } from "./pipeline-step-settings"; import { PipelineStepSettings } from "./pipeline-step-settings";
/** Tools that can be used as pipeline steps (excludes pipeline/batch/multi-file tools). */ /** Tools that can be used as pipeline steps (excludes pipeline/batch/multi-file tools). */
@@ -101,7 +101,7 @@ export function PipelineBuilder({
const addStep = useCallback( const addStep = useCallback(
(toolId: string) => { (toolId: string) => {
const step: PipelineStep = { const step: PipelineStep = {
id: crypto.randomUUID(), id: generateId(),
toolId, toolId,
settings: {}, settings: {},
}; };
+2 -1
View File
@@ -2,6 +2,7 @@ import { Play, Trash2, Workflow } from "lucide-react";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { AppLayout } from "@/components/layout/app-layout"; import { AppLayout } from "@/components/layout/app-layout";
import { PipelineBuilder, type PipelineStep } from "@/components/tools/pipeline-builder"; import { PipelineBuilder, type PipelineStep } from "@/components/tools/pipeline-builder";
import { generateId } from "@/lib/utils";
interface SavedPipeline { interface SavedPipeline {
id: string; id: string;
@@ -144,7 +145,7 @@ export function AutomatePage() {
// Load saved pipeline into builder // Load saved pipeline into builder
const loadSaved = useCallback((pipeline: SavedPipeline) => { const loadSaved = useCallback((pipeline: SavedPipeline) => {
const newSteps: PipelineStep[] = pipeline.steps.map((s) => ({ const newSteps: PipelineStep[] = pipeline.steps.map((s) => ({
id: crypto.randomUUID(), id: generateId(),
toolId: s.toolId, toolId: s.toolId,
settings: { ...s.settings }, settings: { ...s.settings },
})); }));