Chats: disable adding media (and submitting) while media is uploading

This commit is contained in:
Alex Gleason 2023-02-08 13:07:54 -06:00
parent 6eadaf2942
commit 50457d3b8d
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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>
)}