ensure correct sorting even in presence of undefined values

This commit is contained in:
or-else
2018-10-11 12:51:55 +03:00
parent 57ca428a65
commit e43e3ffcbc
+1 -2
View File
@@ -2342,9 +2342,8 @@ class ContactsView extends React.Component {
unreadThreads += c.unread > 0 ? 1 : 0;
contacts.push(c);
});
contacts.sort(function(a, b){
return b.touched - a.touched;
return (b.touched || 0) - (a.touched || 0);
});
updateFavicon(unreadThreads);