decent-chat / decent

Open source messaging platform for the modern web
https://meta.decent.chat
GNU General Public License v3.0
21 stars 5 forks source link

Don't send PATCH request when (confirm edit) pressed if the message wasn't actually edited #310

Open towerofnix opened 6 years ago

towerofnix commented 6 years ago

If you click on the edit button and don't actually change the text in the message, the PATCH request to edit the message shouldn't be sent (since it wouldn't change anything).

The implementation for this should keep track of the value before being edited and only send the request if the value, when the confirm edit button is pressed, is different from the original value. The original value should be scrapped afterwords (once a message edit is finalized, the original value shouldn't be remembered).