From a05be1cd4a5ee4f6711bffff66172e2efe59f154 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Thu, 4 Jan 2024 13:28:31 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20support=20delete=20and=20re?= =?UTF-8?q?generate=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/Conversation/Actions/customAction.ts | 6 ++---- src/features/Conversation/Actions/index.ts | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/features/Conversation/Actions/customAction.ts b/src/features/Conversation/Actions/customAction.ts index 36fb8ce5a22e..dc97c1fee192 100644 --- a/src/features/Conversation/Actions/customAction.ts +++ b/src/features/Conversation/Actions/customAction.ts @@ -1,5 +1,6 @@ import { ActionIconGroupItems } from '@lobehub/ui/es/ActionIconGroup'; import { LanguagesIcon, Play } from 'lucide-react'; +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { localeOptions } from '@/locales/resources'; @@ -23,8 +24,5 @@ export const useCustomActions = () => { label: t('tts.action'), } as ActionIconGroupItems; - return { - translate, - tts, - }; + return useMemo(() => ({ translate, tts }), []); }; diff --git a/src/features/Conversation/Actions/index.ts b/src/features/Conversation/Actions/index.ts index bc501d2a973d..9ad1470a6b63 100644 --- a/src/features/Conversation/Actions/index.ts +++ b/src/features/Conversation/Actions/index.ts @@ -49,6 +49,12 @@ export const useActionsClick = (): OnActionsClick => { break; } + case 'delAndRegenerate': { + resendMessage(id); + deleteMessage(id); + break; + } + case 'tts': { ttsMessage(id); break;