From 4d623fdd440ec4d318d47f39720cc1c3ddb008c9 Mon Sep 17 00:00:00 2001 From: Orenoid Date: Sun, 15 Dec 2024 22:16:37 +0800 Subject: [PATCH] fix: delete input handlers based on their index --- src/app/settings/components/settings.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/settings/components/settings.tsx b/src/app/settings/components/settings.tsx index 6d08df7..4588664 100644 --- a/src/app/settings/components/settings.tsx +++ b/src/app/settings/components/settings.tsx @@ -443,9 +443,7 @@ function CommonChatSettings({ chatSettings, updateChatSettings, className = "" } if (handler.handler.deletable) { updateChatSettings({ ...chatSettings, - inputHandlers: chatSettings.inputHandlers.filter((h) => - h.handler.implType !== handler.handler.implType - ) + inputHandlers: chatSettings.inputHandlers.filter((_, i) => i !== index) }) } }}