Skip to content

Commit

Permalink
✨ feat: support delete and regenerate message
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 4, 2024
1 parent d8f55d5 commit a05be1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/features/Conversation/Actions/customAction.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -23,8 +24,5 @@ export const useCustomActions = () => {
label: t('tts.action'),
} as ActionIconGroupItems;

return {
translate,
tts,
};
return useMemo(() => ({ translate, tts }), []);
};
6 changes: 6 additions & 0 deletions src/features/Conversation/Actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export const useActionsClick = (): OnActionsClick => {
break;
}

case 'delAndRegenerate': {
resendMessage(id);
deleteMessage(id);
break;
}

case 'tts': {
ttsMessage(id);
break;
Expand Down

0 comments on commit a05be1c

Please sign in to comment.