Browse Source

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."
Marc Hartmayer 5 years ago
parent
commit
fc9f0d8392
1 changed files with 2 additions and 2 deletions
  1. 2 2
      client/components/boards/boardBody.js

+ 2 - 2
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);
       },