[Generated By Dashwave AI] Align Message Content Deletion Experience with Web App #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aligns the message content deletion experience with the web app. Key changes include:
ComposeBox.js: Added an if condition to check if the compose box is in 'isEditing' mode. If not, a 'message-empty' error is added as a validation error. If in 'isEditing', the error is not added, allowing users to edit messages with empty content.
ChatScreen.js: Removed the condition checking for empty content (content == "") to allow empty content to be accepted as input when editing messages.
index.js: Commented out the buttons.push(deleteMessage) for conditions where message.isOutbox === true and message.sender_id === ownUser.user_id && messageNotDeleted(message) to refine actionsheets. Added a condition (ownUser.role === 200 && messageNotDeleted(message)) to allow admins to delete messages, using 'ownUser.role' instead of 'ownUser.isAdmin' as the latter is not readable.
These changes ensure a consistent and intuitive message editing and deletion experience across platforms, particularly for admin roles.