diff --git a/lib/public/scripts.js b/lib/public/scripts.js index b55e6a8..717815e 100644 --- a/lib/public/scripts.js +++ b/lib/public/scripts.js @@ -174,10 +174,12 @@ storageContents .sort((a, b) => { - if (a.id < b.id) { + const aDate = new Date(a.createdAt) + const bDate = new Date(b.createdAt) + if (aDate < bDate) { return -1 } - if (a.id > b.id) { + if (aDate > bDate) { return 1 } return 0