diff --git a/.eslintrc.js b/.eslintrc.js index 4ce829ffc3..dfb3307b9c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,5 +4,7 @@ config.extends.push('plugin:@next/next/recommended'); config.rules['unicorn/no-negated-condition'] = 0; config.rules['unicorn/prefer-type-error'] = 0; +config.rules['unicorn/prefer-logical-operator-over-ternary'] = 0; +config.rules['unicorn/no-null'] = 0; module.exports = config; diff --git a/src/pages/chat/[id]/Conversation/Input/index.tsx b/src/pages/chat/[id]/Conversation/Input/index.tsx index f3aec1162e..ab2e94fa11 100644 --- a/src/pages/chat/[id]/Conversation/Input/index.tsx +++ b/src/pages/chat/[id]/Conversation/Input/index.tsx @@ -1,7 +1,7 @@ import { ChatInputArea, DraggablePanel, Icon, Tooltip } from '@lobehub/ui'; import { Button } from 'antd'; import { LucideGalleryVerticalEnd } from 'lucide-react'; -import { memo, useMemo, useState } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { shallow } from 'zustand/shallow'; @@ -18,18 +18,15 @@ const ChatInput = () => { const [text, setText] = useState(''); const [inputHeight] = useSettings((s) => [s.inputHeight], shallow); - const [sendMessage, saveToTopic] = useSessionStore( - (s) => [s.createOrSendMsg, s.saveToTopic], + const [sendMessage, hasTopic, saveToTopic] = useSessionStore( + (s) => [s.createOrSendMsg, !!s.activeTopicId, s.saveToTopic], shallow, ); - const footer = useMemo( - () => ( - -