feat: Add backspace handling to remove last mentioned model

This commit is contained in:
jtsang4 2025-02-20 02:05:48 +08:00 committed by 亢奋猫
parent 173e164d2b
commit f1a9699be4

View File

@ -241,6 +241,11 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
sendMessage()
return event.preventDefault()
}
if (event.key === 'Backspace' && text.trim() === '' && mentionModels.length > 0) {
setMentionModels((prev) => prev.slice(0, -1))
return event.preventDefault()
}
}
const addNewTopic = useCallback(async () => {