feat: modify the background color of chat messages (#1262)

### What problem does this PR solve?

feat: modify the background color of chat messages #1215

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-24 18:23:22 +08:00
committed by GitHub
parent 80163c043e
commit 6c6f5a3a47
4 changed files with 30 additions and 18 deletions

View File

@ -8,6 +8,7 @@ import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
import { IAnswer } from '@/interfaces/database/chat';
import api from '@/utils/api';
import omit from 'lodash/omit';
import trim from 'lodash/trim';
import {
Dispatch,
SetStateAction,
@ -134,7 +135,7 @@ export const useSelectCurrentSharedConversation = (conversationId: string) => {
};
export const useSendButtonDisabled = (value: string) => {
return value === '';
return trim(value) === '';
};
export const useSendSharedMessage = (
@ -205,6 +206,7 @@ export const useSendSharedMessage = (
}, [answer, addNewestAnswer]);
const handlePressEnter = useCallback(() => {
if (trim(value) === '') return;
if (done) {
setValue('');
addNewestConversation(value);