update sorting to put downloads in progress first

This commit is contained in:
Akinwale Ariwodola 2018-08-31 08:41:45 +01:00
parent bd307d8108
commit 87d3e3f389

View file

@ -61,6 +61,7 @@ class DownloadsPage extends React.PureComponent {
data={fileInfos.sort((a, b) => { data={fileInfos.sort((a, b) => {
// TODO: Implement sort based on user selection // TODO: Implement sort based on user selection
if (!a.completed && b.completed) return -1; if (!a.completed && b.completed) return -1;
if (a.completed && !b.completed) return 1;
if (a.metadata.title === b.metadata.title) return 0; if (a.metadata.title === b.metadata.title) return 0;
return (a.metadata.title < b.metadata.title) ? -1 : 1; return (a.metadata.title < b.metadata.title) ? -1 : 1;
})} })}