Merge pull request #1115 from PolarizedIons/fix-sorting

Fix channel sorting messing up the order
This commit is contained in:
Pavel Djundik 2017-04-29 14:56:19 +03:00 committed by GitHub
commit 8ad92ed7b7

View File

@ -423,7 +423,7 @@ Client.prototype.sort = function(data) {
switch (data.type) {
case "networks":
this.networks.sort((a, b) => {
return order.indexOf(a.id) > order.indexOf(b.id);
return order.indexOf(a.id) - order.indexOf(b.id);
});
// Sync order to connected clients
@ -438,7 +438,7 @@ Client.prototype.sort = function(data) {
}
network.channels.sort((a, b) => {
return order.indexOf(a.id) > order.indexOf(b.id);
return order.indexOf(a.id) - order.indexOf(b.id);
});
// Sync order to connected clients