浏览代码

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 年之前
父节点
当前提交
fc9f0d8392
共有 1 个文件被更改,包括 2 次插入2 次删除
  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);
       },