Merge pull request #355 from pdehaan/issue-155

Make order of uploaded files in list consistent
This commit is contained in:
Danny Coates 2017-07-30 23:18:07 -07:00 committed by GitHub
commit 6d20f09d0a
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,11 @@ class Storage {
fs.push(JSON.parse(this.engine.getItem(k))); // parse or whatever else fs.push(JSON.parse(this.engine.getItem(k))); // parse or whatever else
} }
} }
return fs; return fs.sort((file1, file2) => {
const creationDate1 = new Date(file1.creationDate);
const creationDate2 = new Date(file2.creationDate);
return creationDate1 - creationDate2;
});
} }
get numFiles() { get numFiles() {