Skip to content

Commit

Permalink
Sort pins last in thread view (#6426)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Nov 16, 2024
1 parent edaf230 commit 965bcc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/state/queries/post-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ export function sortThread(
}
}

const aPin = Boolean(a.record.text.trim() === '📌')
const bPin = Boolean(b.record.text.trim() === '📌')
if (aPin !== bPin) {
if (aPin) {
return 1
}
if (bPin) {
return -1
}
}

if (opts.prioritizeFollowedUsers) {
const af = a.post.author.viewer?.following
const bf = b.post.author.viewer?.following
Expand Down

0 comments on commit 965bcc4

Please sign in to comment.