From 3e144c42279ce0b0e1c329d244750ee088f89136 Mon Sep 17 00:00:00 2001 From: Patrickill <1322301665@qq.com> Date: Fri, 13 Sep 2024 11:59:41 +0800 Subject: [PATCH] remove the trailing #xx when copy --- .../components/WorkflowComponents/Flow/hooks/useUtils.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useUtils.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useUtils.tsx index f0d973c6f..125cb5966 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useUtils.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useUtils.tsx @@ -27,7 +27,9 @@ export const useWorkflowUtils = () => { } } }).length; - return nodeLength > 0 ? `${templateName}#${nodeLength + 1}` : templateName; + return nodeLength > 0 + ? `${templateName.replace(/#\d+$/, '')}#${nodeLength + 1}` + : templateName; }, [nodeList] );