sort returns compare value and not bool

This commit is contained in:
Girish Ramakrishnan
2020-04-18 22:56:12 -07:00
parent eb90b614ea
commit 861204e442

View File

@@ -229,7 +229,9 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
usageOther -= tmp;
});
if ($scope.disks.disks[0] === disk) { // the root mount point is the first disk
disk.contains.sort(function (x, y) { return y.usage - x.usage; }); // sort by usage
if ($scope.disks.disks[0] === disk) { // the root mount point is the first disk. keep this 'contains' in the end
disk.contains.push({
label: 'Everything else (Ubuntu, Swap, etc)',
id: 'other',
@@ -238,8 +240,6 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
});
}
disk.contains.sort(function (x, y) { return x.usage > y.usage; }); // sort by usage
iteratorCallback();
});
});