From 1cc81deb69486b25d8697f5e78daeda3ec21ff84 Mon Sep 17 00:00:00 2001 From: CaIon Date: Sun, 10 Aug 2025 12:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Enhance=20EditChannelModal?= =?UTF-8?q?=20with=20JSONEditor=20key=20updates=20and=20input=20reset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added unique keys for JSONEditor components to ensure proper re-rendering based on channelId. - Implemented input reset to clear previous JSON field values when the modal is opened. --- .../components/table/channels/modals/EditChannelModal.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/components/table/channels/modals/EditChannelModal.jsx b/web/src/components/table/channels/modals/EditChannelModal.jsx index b86aade5..360aedf2 100644 --- a/web/src/components/table/channels/modals/EditChannelModal.jsx +++ b/web/src/components/table/channels/modals/EditChannelModal.jsx @@ -587,6 +587,8 @@ const EditChannelModal = (props) => { if (formApiRef.current) { formApiRef.current.setValue('key_mode', undefined); } + // 重置本地输入,避免下次打开残留上一次的 JSON 字段值 + setInputs(getInitValues()); } }, [props.visible, channelId]); @@ -1257,6 +1259,7 @@ const EditChannelModal = (props) => { {inputs.type === 41 && ( { /> { />