diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/timeline.js b/timeline.js index d746d00..fb7a685 100644 --- a/timeline.js +++ b/timeline.js @@ -95,7 +95,7 @@ class ReaderTimeline extends HTMLElement { let count = 0 if (this.sort === 'random') { - for await (const note of db.searchNotes({ limit: this.limit })) { + for await (const note of db.searchNotes({}, { limit: this.limit, sort: this.sort === 'random' ? 0 : (this.sort === 'oldest' ? 1 : -1) })) { this.appendNoteElement(note) count++ }