Skip to content

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

Merged
sampaiodiego merged 3 commits into
RocketChat:developfrom
matthias4217:fix-25478-edit-button
Jun 30, 2022
Merged

sampaiodiego merged 3 commits into
RocketChat:developfrom
matthias4217:fix-25478-edit-button

Conversation

@matthias4217

@matthias4217 matthias4217 commented Jun 2, 2022 •

Copy link
Copy Markdown
Contributor

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

CLAassistant commented Jun 2, 2022 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@matthias4217
matthias4217 force-pushed the fix-25478-edit-button branch from c7b431d to f6d0212 Compare June 2, 2022 14:27
@@ -171,7 +171,7 @@ Meteor.startup(async function () {
if (msgTs != null) {
currentTsDiff = moment().diff(msgTs, 'minutes');

Copy link
Copy Markdown
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
Copy Markdown
Member

thx a lot for your contribution @matthias4217

@danel1

danel1 commented Jul 6, 2022

Copy link
Copy Markdown

@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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

4.7.1 option to edit message not shown anymore 4.7.0 regression: edit button not displayed in the first minute after sending a new message

5 participants