fix: 需要只发送图片功能 #538
This commit is contained in:
parent
5337017648
commit
5d2efbd62b
@ -90,6 +90,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
[estimateTextTokens, showInputEstimatedTokens, text]
|
[estimateTextTokens, showInputEstimatedTokens, text]
|
||||||
)
|
)
|
||||||
const newTopicShortcut = useShortcutDisplay('new_topic')
|
const newTopicShortcut = useShortcutDisplay('new_topic')
|
||||||
|
const inputEmpty = isEmpty(text.trim()) && files.length === 0
|
||||||
|
|
||||||
_text = text
|
_text = text
|
||||||
_files = files
|
_files = files
|
||||||
@ -100,7 +101,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmpty(text.trim())) {
|
if (inputEmpty) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
setTimeout(() => resizeTextArea(), 0)
|
setTimeout(() => resizeTextArea(), 0)
|
||||||
|
|
||||||
setExpend(false)
|
setExpend(false)
|
||||||
}, [assistant.id, assistant.topics, generating, files, text, selectedKnowledgeBase])
|
}, [generating, inputEmpty, text, assistant.id, assistant.topics, selectedKnowledgeBase, files])
|
||||||
|
|
||||||
const translate = async () => {
|
const translate = async () => {
|
||||||
if (isTranslating) {
|
if (isTranslating) {
|
||||||
@ -492,7 +493,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{!generating && <SendMessageButton sendMessage={sendMessage} disabled={generating || !text} />}
|
{!generating && <SendMessageButton sendMessage={sendMessage} disabled={generating || inputEmpty} />}
|
||||||
</ToolbarMenu>
|
</ToolbarMenu>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</InputBarContainer>
|
</InputBarContainer>
|
||||||
|
|||||||
@ -117,8 +117,8 @@ const DisplaySettings: FC = () => {
|
|||||||
<SettingTitle>{t('settings.display.custom.css')}</SettingTitle>
|
<SettingTitle>{t('settings.display.custom.css')}</SettingTitle>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
value={customCss}
|
defaultValue={customCss}
|
||||||
onChange={(e) => dispatch(setCustomCss(e.target.value))}
|
onBlur={(e) => dispatch(setCustomCss(e.target.value))}
|
||||||
placeholder={t('settings.display.custom.css.placeholder')}
|
placeholder={t('settings.display.custom.css.placeholder')}
|
||||||
style={{
|
style={{
|
||||||
minHeight: 200,
|
minHeight: 200,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user