From dca97b7eb40afd439fb3c1587bb8eff70d0e353a Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 22 Jan 2025 21:13:21 +0000 Subject: [PATCH] Tweak adjustment in the formula (#7547) * Remove ts-ignore * Tweak OP like adjustment --- package.json | 2 +- src/state/queries/post-thread.ts | 5 ++--- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 88ef900238..f38093caab 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "icons:optimize": "svgo -f ./assets/icons" }, "dependencies": { - "@atproto/api": "^0.13.28", + "@atproto/api": "^0.13.30", "@bitdrift/react-native": "^0.6.2", "@braintree/sanitize-url": "^6.0.2", "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", diff --git a/src/state/queries/post-thread.ts b/src/state/queries/post-thread.ts index 13ecce9a62..79350c119b 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, diff --git a/yarn.lock b/yarn.lock index b462e66574..187ad5b0cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -72,10 +72,10 @@ tlds "^1.234.0" zod "^3.23.8" -"@atproto/api@^0.13.28": - version "0.13.28" - resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.13.28.tgz#b36d4ad9485724ec030e7292599f048ab62a9fcc" - integrity sha512-qBuEI5aNe2/KjmtmtLMilnpZc+FRAsAM3/5nFOQPEudUk388ctNsmKdz2Nti4OvCebn+50EB6V3lju596CTUNA== +"@atproto/api@^0.13.30": + version "0.13.30" + resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.13.30.tgz#073165003303995d0b6b7dfc24dafb8a58a1db6f" + integrity sha512-U+3XUACcCuoEvszh48vnzZITr1D7xZ8yz3EqjadYtV+zb3KjBmGroa50eaSRqHyeaDUZF38knumHPyUe9tTuqg== dependencies: "@atproto/common-web" "^0.3.2" "@atproto/lexicon" "^0.4.5"