about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-07-11 15:20:22 -0500
committerGitHub <noreply@github.com>2024-07-11 21:20:22 +0100
commitea0586cd67427ce68f867ee25e03bb92169f23c3 (patch)
tree4f13114f11345d5ca754779244f008df0f90ee23 /src
parent15a00b18642c226e9e98dae47edcfdb7cc42308f (diff)
downloadvoidsky-ea0586cd67427ce68f867ee25e03bb92169f23c3.tar.zst
Filter yourself out of follows interstitial (#4770)
Diffstat (limited to 'src')
-rw-r--r--src/components/FeedInterstitials.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx
index 243db0a49..53c1fac0b 100644
--- a/src/components/FeedInterstitials.tsx
+++ b/src/components/FeedInterstitials.tsx
@@ -13,6 +13,7 @@ import {logger} from '#/logger'
 import {useModerationOpts} from '#/state/preferences/moderation-opts'
 import {useGetPopularFeedsQuery} from '#/state/queries/feed'
 import {useProfilesQuery} from '#/state/queries/profile'
+import {useSession} from '#/state/session'
 import {useProgressGuide} from '#/state/shell/progress-guide'
 import * as userActionHistory from '#/state/userActionHistory'
 import {SeenPost} from '#/state/userActionHistory'
@@ -127,6 +128,7 @@ function sortSeenPosts(postA: SeenPost, postB: SeenPost): 0 | 1 | -1 {
 }
 
 function useExperimentalSuggestedUsersQuery() {
+  const {currentAccount} = useSession()
   const userActionSnapshot = userActionHistory.useActionHistorySnapshot()
   const dids = React.useMemo(() => {
     const {likes, follows, seen} = userActionSnapshot
@@ -138,8 +140,10 @@ function useExperimentalSuggestedUsersQuery() {
       .sort(sortSeenPosts)
       .map(l => new AtUri(l.uri))
       .map(uri => uri.host)
-    return [...new Set([...likeDids, ...seenDids])]
-  }, [userActionSnapshot])
+    return [...new Set([...likeDids, ...seenDids])].filter(
+      did => did !== currentAccount?.did,
+    )
+  }, [userActionSnapshot, currentAccount])
   const {data, isLoading, error} = useProfilesQuery({
     handles: dids.slice(0, 16),
   })