From ea0586cd67427ce68f867ee25e03bb92169f23c3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 11 Jul 2024 15:20:22 -0500 Subject: [PATCH] Filter yourself out of follows interstitial (#4770) --- src/components/FeedInterstitials.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx index 243db0a491..53c1fac0b9 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), })