about summary refs log tree commit diff
path: root/src/state/queries/post-thread.ts
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2025-01-22 21:13:21 +0000
committerGitHub <noreply@github.com>2025-01-22 21:13:21 +0000
commitdca97b7eb40afd439fb3c1587bb8eff70d0e353a (patch)
treee88ad41cd1ff53ff845cd41ededcea704a68cdb8 /src/state/queries/post-thread.ts
parent74bb65714b7c7b128ddb27438773b149bbe5ec6c (diff)
downloadvoidsky-dca97b7eb40afd439fb3c1587bb8eff70d0e353a.tar.zst
Tweak adjustment in the formula (#7547)
* Remove ts-ignore

* Tweak OP like adjustment
Diffstat (limited to 'src/state/queries/post-thread.ts')
-rw-r--r--src/state/queries/post-thread.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state/queries/post-thread.ts b/src/state/queries/post-thread.ts
index 13ecce9a6..79350c119 100644
--- a/src/state/queries/post-thread.ts
+++ b/src/state/queries/post-thread.ts
@@ -318,9 +318,9 @@ function getHotness(threadPost: ThreadPost, fetchedAt: number) {
       (1000 * 60 * 60),
   )
   const likeCount = post.likeCount ?? 0
-  const likeOrder = Math.log(3 + likeCount)
+  const likeOrder = Math.log(3 + likeCount) * (hasOPLike ? 1.45 : 1.0)
   const timePenaltyExponent = 1.5 + 1.5 / (1 + Math.log(1 + likeCount))
-  const opLikeBoost = hasOPLike ? 0.85 : 1.0
+  const opLikeBoost = hasOPLike ? 0.8 : 1.0
   const timePenalty = Math.pow(hoursAgo + 2, timePenaltyExponent * opLikeBoost)
   return likeOrder / timePenalty
 }
@@ -359,7 +359,6 @@ function responseToThreadNodes(
               // do not show blocked posts in replies
               .filter(node => node.type !== 'blocked')
           : undefined,
-      // @ts-ignore TODO: Update API package.
       hasOPLike: Boolean(node?.threadContext?.rootAuthorLike),
       ctx: {
         depth,