Duplicating a copy names it after the original; a failed duplicate or delete says why

This commit is contained in:
2026-11-01 10:59:36 +01:00
parent 8f4c7d8ff1
commit 7f40ea62de
3 changed files with 25 additions and 12 deletions
@@ -3,6 +3,7 @@ import { Check, Copy, Plus, Search, Trash2 } from "lucide-react"
import { motion } from "motion/react"
import { type ReactNode, useRef, useState } from "react"
import type { ApiError } from "@/client"
import { Button } from "@/components/ui/button"
import {
Dialog,
@@ -22,6 +23,7 @@ import {
} from "@/components/ui/tooltip"
import useCustomToast from "@/hooks/useCustomToast"
import { transitions } from "@/lib/motion"
import { extractErrorMessage } from "@/utils"
/**
* The bar over the flows and dashboards lists: find one, publish what is
@@ -233,8 +235,8 @@ function useBatch(
for (const name of names) {
try {
await act(name)
} catch {
failed.push(name)
} catch (err) {
failed.push(`${name} (${extractErrorMessage(err as ApiError)})`)
}
}
return failed