mirror of
https://github.com/open-webui/open-webui
synced 2025-02-07 21:47:29 +00:00
refac: channel message input
This commit is contained in:
parent
995f80002f
commit
60fc24cd39
@ -136,7 +136,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const submitHandler = async ({ content, data }) => {
|
const submitHandler = async ({ content, data }) => {
|
||||||
if (!content) {
|
if (!content && (data?.files ?? []).length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const submitHandler = async () => {
|
const submitHandler = async () => {
|
||||||
if (content === '') {
|
if (content === '' && files.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,11 +581,11 @@
|
|||||||
<Tooltip content={$i18n.t('Send message')}>
|
<Tooltip content={$i18n.t('Send message')}>
|
||||||
<button
|
<button
|
||||||
id="send-message-button"
|
id="send-message-button"
|
||||||
class="{content !== ''
|
class="{content !== '' || files.length !== 0
|
||||||
? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
|
? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
|
||||||
: 'text-white bg-gray-200 dark:text-gray-900 dark:bg-gray-700 disabled'} transition rounded-full p-1.5 self-center"
|
: 'text-white bg-gray-200 dark:text-gray-900 dark:bg-gray-700 disabled'} transition rounded-full p-1.5 self-center"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={content === ''}
|
disabled={content === '' && files.length === 0}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
Loading…
Reference in New Issue
Block a user