From 833e7c47e4f5bc642097ff18bf1b48310f264794 Mon Sep 17 00:00:00 2001 From: KshitizSareen Date: Tue, 17 Jan 2023 18:50:06 -0800 Subject: [PATCH 1/3] Removed unnceccessary checks for checking if content and topic are empty strings --- src/chat/ChatScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/ChatScreen.js b/src/chat/ChatScreen.js index 7e6af9438b0..05f61046379 100644 --- a/src/chat/ChatScreen.js +++ b/src/chat/ChatScreen.js @@ -164,7 +164,7 @@ export default function ChatScreen(props: Props): Node { () => undefined, ); - if ((content !== undefined && content !== '') || (topic !== undefined && topic !== '')) { + if (content !== undefined || topic !== undefined) { api.updateMessage(auth, editMessage.id, { content, subject: topic }).catch(error => { showErrorAlert(_('Failed to edit message'), error.message); }); From fd14b17de1d9ae07a2499bcc1a542947a7081a05 Mon Sep 17 00:00:00 2001 From: KshitizSareen Date: Tue, 17 Jan 2023 18:51:40 -0800 Subject: [PATCH 2/3] Removed delete message option of own users messages and left it for message.isOutbox == true --- src/action-sheets/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/action-sheets/index.js b/src/action-sheets/index.js index 7bc8fff5736..6d37b274a88 100644 --- a/src/action-sheets/index.js +++ b/src/action-sheets/index.js @@ -728,7 +728,6 @@ export const constructMessageActionButtons = (args: {| } if (message.sender_id === ownUser.user_id && messageNotDeleted(message)) { // TODO(#2793): Don't show if message isn't deletable. - buttons.push(deleteMessage); } if ( // When do we offer "Mark as unread from here"? This logic parallels From a2175794fbf8c11b4e62f618787b9d8cd52939a8 Mon Sep 17 00:00:00 2001 From: KshitizSareen Date: Tue, 17 Jan 2023 18:55:34 -0800 Subject: [PATCH 3/3] Removed Validation error of Message Empty when user is in editing mode --- src/compose/ComposeBox.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compose/ComposeBox.js b/src/compose/ComposeBox.js index 46077101656..70825f800a6 100644 --- a/src/compose/ComposeBox.js +++ b/src/compose/ComposeBox.js @@ -521,7 +521,7 @@ const ComposeBox: React$AbstractComponent = forwardRef( result.push('mandatory-topic-empty'); } - if (messageInputValue.trim().length === 0) { + if (messageInputValue.trim().length === 0 && !isEditing) { result.push('message-empty'); } @@ -540,6 +540,7 @@ const ComposeBox: React$AbstractComponent = forwardRef( numUploading, anyQuoteAndReplyInProgress, messageInputState, + isEditing, ]); const submitButtonDisabled = validationErrors.length > 0;