From bef955dd7dc01cd6899e107f27af9f322c71662a Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Thu, 20 Jul 2023 02:11:15 +0800 Subject: [PATCH] fix clone --- src/chatbox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chatbox.tsx b/src/chatbox.tsx index 3f1114e..7902ce2 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -384,7 +384,7 @@ export default function ChatBOX(props: { return; } t.name = name; - setTemplates([...templates]); + setTemplates(structuredClone(templates)); }} > 🖋 @@ -397,7 +397,7 @@ export default function ChatBOX(props: { return; } templates.splice(index, 1); - setTemplates([...templates]); + setTemplates(structuredClone(templates)); }} > ❌