From 50457d3b8ded44fac7a3269c94d97107e65c8a13 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 8 Feb 2023 13:07:54 -0600 Subject: [PATCH] Chats: disable adding media (and submitting) while media is uploading --- app/soapbox/features/chats/components/chat-composer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/chats/components/chat-composer.tsx b/app/soapbox/features/chats/components/chat-composer.tsx index 2cda01254..0b885c0c7 100644 --- a/app/soapbox/features/chats/components/chat-composer.tsx +++ b/app/soapbox/features/chats/components/chat-composer.tsx @@ -80,7 +80,7 @@ const ChatComposer = React.forwardRef 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 resetFileKey={resetFileKey} iconClassName='w-5 h-5' className='text-primary-500' - disabled={attachments.length >= attachmentLimit} + disabled={isUploading || (attachments.length >= attachmentLimit)} /> )}