Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Not showing edit message button when blocking edit after N minutes #25724

Merged
merged 3 commits into from
Jun 30, 2022

Conversation

matthias4217
Copy link
Contributor

@matthias4217 matthias4217 commented Jun 2, 2022

Proposed changes (including videos or screenshots)

Previously, in Rocketchat 4.7.0 and later, as mentioned in #25478, the edit button was not displayed on the interface in the minute after having sent a message. This is now fixed : messages can be edited right after sending them.

Issues

Steps to test or reproduce

I've tested this locally. Without this patch, the edit button isn't shown after sending a message. With it, it is now shown immediately.

Further comments

This is my first pull request to RocketChat. Please tell me if I need to change anything.

@CLAassistant
Copy link

CLAassistant commented Jun 2, 2022

CLA assistant check
All committers have signed the CLA.

@@ -171,7 +171,7 @@ Meteor.startup(async function () {
if (msgTs != null) {
currentTsDiff = moment().diff(msgTs, 'minutes');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the current change, I could have changed currentTsDiff = moment().diff(msgTs, 'minutes'); (which returns an Integer) to currentTsDiff = moment().diff(msgTs, 'minutes', true);, which returns a precise float, meaning currentTsDiff would never equal 0.

I don't know if you have any preference ?

sampaiodiego
sampaiodiego previously approved these changes Jun 29, 2022
@sampaiodiego sampaiodiego changed the title [FIX] Display edit button right after sending message (#25478, #25533) [FIX] Not showing edit message button when blocking edit after N minutes Jun 30, 2022
@sampaiodiego sampaiodiego merged commit f7513fa into RocketChat:develop Jun 30, 2022
@sampaiodiego sampaiodiego added this to the 5.0.0 milestone Jun 30, 2022
@sampaiodiego
Copy link
Member

thx a lot for your contribution @matthias4217

@danel1
Copy link

danel1 commented Jul 6, 2022

@sampaiodiego @debdutdeb Hey guys, thanks for commiting to develop and preparing for 5.x. We do not really wan't to upgrade directly to 5.x after release to due "stability-reasons". Would it therefore be possible, to pick this for 4.8.2 - maybe with other bugfixes and release asap as "Bugfix Update" so users have a choice? Thanks!

@sampaiodiego
Copy link
Member

fair enough @danel1 , I'll add this one to 4.8.2 milestone.. not promising we'll actually make it, but if we make it, this one will be included, ok?

@sampaiodiego sampaiodiego modified the milestones: 5.0.0, 4.8.2 Jul 6, 2022
sampaiodiego added a commit that referenced this pull request Jul 20, 2022
…tes (#25724)

Co-authored-by: Diego Sampaio <chinello@gmail.com>
@sampaiodiego sampaiodiego mentioned this pull request Jul 20, 2022
@murtaza98 murtaza98 mentioned this pull request Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants