From 3dcf901043ebecb464bb94e8e56fa3ead76cc6dd Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 24 Mar 2026 15:32:25 +0800 Subject: [PATCH] fix(web): agent copy --- web/src/views/ApplicationConfig/Agent.tsx | 6 ++---- web/src/views/ApplicationConfig/components/CopyModal.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index d9212bef..6b5a6cb0 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:29:21 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-24 11:02:34 + * @Last Modified time: 2026-03-24 15:27:30 */ import { useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react'; import { useTranslation } from 'react-i18next' @@ -62,8 +62,6 @@ const Agent = forwardRef([], form) const [isSave, setIsSave] = useState(false) const initialized = useRef(false) - - console.log('chatList', chatList) // Initialization flag useEffect(() => { @@ -81,7 +79,7 @@ const Agent = forwardRef { getModels() getData() - }, []) + }, [id]) /** * Fetch agent configuration data diff --git a/web/src/views/ApplicationConfig/components/CopyModal.tsx b/web/src/views/ApplicationConfig/components/CopyModal.tsx index 7eaf1497..e9c20368 100644 --- a/web/src/views/ApplicationConfig/components/CopyModal.tsx +++ b/web/src/views/ApplicationConfig/components/CopyModal.tsx @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 16:27:56 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 16:27:56 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-03-24 15:28:20 */ /** * Copy Application Modal @@ -60,7 +60,8 @@ const CopyModal = forwardRef(({ copyApplication(data.id, values.new_name) .then((res) => { const resData = res as Application - navigate(`/application/config/${resData.id}`) + navigate(`/application/config/${resData.id}`, { replace: true }) + handleClose() }) .finally(() => { setLoading(false)