From 828bd71f22627eaf21fe7b801923c54828583e59 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 8 Sep 2024 20:57:49 +0800 Subject: [PATCH] feat: Remove activeAssistant dependency, add assistant dependency - Updated the `onEditAssistant` function to remove dependency on `activeAssistant` variable and add `assistant` as a dependency. --- src/renderer/src/pages/home/Navbar.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index a68c8502..ecd949c7 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -33,14 +33,11 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant }) => { assistant && setActiveAssistant(assistant) } - const onEditAssistant = useCallback( - async (assistant: Assistant) => { - const _assistant = await AssistantSettingPopup.show({ assistant }) - updateAssistant(_assistant) - syncAsistantToAgent(_assistant) - }, - [updateAssistant] - ) + const onEditAssistant = useCallback(async () => { + const _assistant = await AssistantSettingPopup.show({ assistant }) + updateAssistant(_assistant) + syncAsistantToAgent(_assistant) + }, [assistant, updateAssistant]) return (