Fix channel sorting messing up the order

This commit is contained in:
PolarizedIons 2017-04-29 13:17:21 +02:00
parent 5eb5b99115
commit dd48ba4e87

View File

@ -422,7 +422,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
@ -437,7 +437,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