Skip to content

Commit

Permalink
fix: pass dynamic sort parameter for random note fetching in timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshthite committed Jun 3, 2024
1 parent cbbf2f7 commit e029220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
2 changes: 1 addition & 1 deletion timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}
Expand Down

0 comments on commit e029220

Please sign in to comment.