Skip to content

Commit

Permalink
chore: add a TODO to consider removing duplicates in the random sort …
Browse files Browse the repository at this point in the history
…for better UX in the future
  • Loading branch information
akhileshthite committed May 30, 2024
1 parent 529e158 commit cbbf2f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export class ActivityPubDB extends EventTarget {
const index = tx.store.index(indexName)

if (sort === 0) { // Random sort
// TODO: Consider removing duplicates in the future to improve UX
const totalNotes = await index.count()
for (let i = 0; i < limit; i++) {
const randomSkip = Math.floor(Math.random() * totalNotes)
Expand Down

0 comments on commit cbbf2f7

Please sign in to comment.