about summary refs log tree commit diff
path: root/src/state/queries/post.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-07-04 16:28:38 -0500
committerGitHub <noreply@github.com>2024-07-04 22:28:38 +0100
commit3407206f52a03223b9eba925f030cf371833a8ed (patch)
tree33060612a4a5b23232d85b966906ad7f0a1ba35d /src/state/queries/post.ts
parent1c6bfc02fb9da56281bdc449a951725fb2ec808d (diff)
downloadvoidsky-3407206f52a03223b9eba925f030cf371833a8ed.tar.zst
[D1X] Use user action and viewing history to inform suggested follows (#4727)
* Use user action and viewing history to inform suggested follows

* Remove dynamic spreads

* Track more info about seen posts

* Add ranking

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/state/queries/post.ts')
-rw-r--r--src/state/queries/post.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/state/queries/post.ts b/src/state/queries/post.ts
index a511d6b3d..071a2e91f 100644
--- a/src/state/queries/post.ts
+++ b/src/state/queries/post.ts
@@ -8,6 +8,7 @@ import {logEvent, LogEvents, toClout} from '#/lib/statsig/statsig'
 import {updatePostShadow} from '#/state/cache/post-shadow'
 import {Shadow} from '#/state/cache/types'
 import {useAgent, useSession} from '#/state/session'
+import * as userActionHistory from '#/state/userActionHistory'
 import {useIsThreadMuted, useSetThreadMute} from '../cache/thread-mutes'
 import {findProfileQueryData} from './profile'
 
@@ -92,6 +93,7 @@ export function usePostLikeMutationQueue(
           uri: postUri,
           cid: postCid,
         })
+        userActionHistory.like([postUri])
         return likeUri
       } else {
         if (prevLikeUri) {
@@ -99,6 +101,7 @@ export function usePostLikeMutationQueue(
             postUri: postUri,
             likeUri: prevLikeUri,
           })
+          userActionHistory.unlike([postUri])
         }
         return undefined
       }