Chats: disable adding media (and submitting) while media is uploading
This commit is contained in:
parent
6eadaf2942
commit
50457d3b8d
1 changed files with 2 additions and 2 deletions
|
@ -80,7 +80,7 @@ const ChatComposer = React.forwardRef<HTMLTextAreaElement | null, IChatComposer>
|
|||
|
||||
const hasAttachment = attachments.length > 0;
|
||||
const isOverCharacterLimit = maxCharacterCount && value?.length > maxCharacterCount;
|
||||
const isSubmitDisabled = disabled || isOverCharacterLimit || (value.length === 0 && !hasAttachment);
|
||||
const isSubmitDisabled = disabled || isUploading || isOverCharacterLimit || (value.length === 0 && !hasAttachment);
|
||||
|
||||
const overLimitText = maxCharacterCount ? maxCharacterCount - value?.length : '';
|
||||
|
||||
|
@ -173,7 +173,7 @@ const ChatComposer = React.forwardRef<HTMLTextAreaElement | null, IChatComposer>
|
|||
resetFileKey={resetFileKey}
|
||||
iconClassName='w-5 h-5'
|
||||
className='text-primary-500'
|
||||
disabled={attachments.length >= attachmentLimit}
|
||||
disabled={isUploading || (attachments.length >= attachmentLimit)}
|
||||
/>
|
||||
</Stack>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue