Fix sorting bug

This commit is contained in:
John Furrow
2016-01-07 18:26:04 -08:00
parent 23ba989d81
commit 6819f759a3
2 changed files with 14 additions and 15 deletions
+2 -3
View File
@@ -2,9 +2,8 @@ export function sortTorrents(torrents, sortBy) {
if (torrents.length) {
let direction = sortBy.direction;
let property = sortBy.property;
let sortedTorrents = Object.assign([], torrents);
sortedTorrents.sort(function(a, b) {
torrents.sort(function(a, b) {
let valA = a[property];
let valB = b[property];
@@ -49,7 +48,7 @@ export function sortTorrents(torrents, sortBy) {
return 0;
});
return sortedTorrents;
return torrents;
} else {
return torrents;
}