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."
This commit is contained in:
Marc Hartmayer 2020-05-24 12:53:15 +02:00
parent cfa2bbd3d4
commit fc9f0d8392

View file

@ -378,8 +378,8 @@ BlazeComponent.extendComponent({
new Date(card.dueAt.getTime() + 36e5), new Date(card.dueAt.getTime() + 36e5),
); );
}); });
events.sort(function(first, second) { events.sort((first, second) => {
return first.id > second.id ? 1 : -1; return first.id === second.id ? 0 : first.id > second.id ? 1 : -1;
}); });
callback(events); callback(events);
}, },