Skip to content

Commit

Permalink
Use Date.getTime instead of moment to improve perf in isConsecutiveAc…
Browse files Browse the repository at this point in the history
…tionMadeByPreviousActor
  • Loading branch information
janicduplessis committed May 11, 2023
1 parent 5df596f commit a9d40cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ReportActionsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function isConsecutiveActionMadeByPreviousActor(reportActions, actionIndex) {
}

// Comments are only grouped if they happen within 5 minutes of each other
if (moment(currentAction.created).unix() - moment(previousAction.created).unix() > 300) {
if (new Date(currentAction.created).getTime() - new Date(previousAction.created).getTime() > 300000) {
return false;
}

Expand Down

0 comments on commit a9d40cb

Please sign in to comment.