Explorar o código

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 %!s(int64=5) %!d(string=hai) anos
pai
achega
fc9f0d8392
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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);
       },