From a9d40cb0ae600efd0a1226767ef41a2e2819911e Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Thu, 11 May 2023 11:44:52 -0400 Subject: [PATCH] Use Date.getTime instead of moment to improve perf in isConsecutiveActionMadeByPreviousActor --- src/libs/ReportActionsUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index de77e7f5243e..d5b9792b921b 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -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; }