mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
feat: sort all items by dateCreated
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Indexer from "./indexer";
|
||||
import sort from "fast-sort";
|
||||
|
||||
export default class CachedCollection {
|
||||
constructor(context, type) {
|
||||
@@ -65,9 +66,9 @@ export default class CachedCollection {
|
||||
|
||||
getAllItems() {
|
||||
let items = [];
|
||||
for (let value of this.map.values()) {
|
||||
this.map.forEach(value => {
|
||||
items[items.length] = value;
|
||||
}
|
||||
return items;
|
||||
});
|
||||
return sort(items).desc(u => u.dateCreated);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user