From b2fee6a6c196f2ed2788444ad2387fba8f6df9cb Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sun, 24 May 2020 12:37:54 +0200 Subject: Use an arrow function inside forEach() instead of an anonymous function Suggested by deepcode.ai. --- client/components/boards/boardBody.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 4e473f18..78418f2a 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -365,12 +365,12 @@ BlazeComponent.extendComponent({ }; currentBoard .cardsInInterval(start.toDate(), end.toDate()) - .forEach(function(card) { + .forEach(card => { pushEvent(card); }); currentBoard .cardsDueInBetween(start.toDate(), end.toDate()) - .forEach(function(card) { + .forEach(card => { pushEvent( card, `${card.title} ${TAPi18n.__('card-due')}`, -- cgit v1.2.3-1-g7c22 From fc9f0d83921a526ca81c73381ac93cfcb9bb6fd9 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sun, 24 May 2020 12:53:15 +0200 Subject: Sort callback should return 0 if values are equal Fixes: "The callback [:381] provided to sort [:381] should return 0 if the compared values are equal." --- client/components/boards/boardBody.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 78418f2a..e70faa49 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -378,8 +378,8 @@ BlazeComponent.extendComponent({ new Date(card.dueAt.getTime() + 36e5), ); }); - events.sort(function(first, second) { - return first.id > second.id ? 1 : -1; + events.sort((first, second) => { + return first.id === second.id ? 0 : first.id > second.id ? 1 : -1; }); callback(events); }, -- cgit v1.2.3-1-g7c22