From b3faaa6121f9bfc80d46f20ef10b0c9827f16216 Mon Sep 17 00:00:00 2001 From: rimar1337 <132627503+rimar1337@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:14:41 +0700 Subject: [PATCH] actual mutuals indicator --- src/routes/profile.$did/index.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/routes/profile.$did/index.tsx b/src/routes/profile.$did/index.tsx index 1e0d24e..e055404 100644 --- a/src/routes/profile.$did/index.tsx +++ b/src/routes/profile.$did/index.tsx @@ -286,23 +286,37 @@ export function Mutual({targetdidorhandle}:{targetdidorhandle: string}) { const {agent} = useAuth() const {data: identity} = useQueryIdentity(targetdidorhandle); - const mutualfollows = useGetOneToOneState(agent?.did ? { + const theyFollowYouRes = useGetOneToOneState(agent?.did ? { target: agent?.did, user: identity?.did ?? targetdidorhandle, collection: "app.bsky.graph.follow", path: ".subject" }:undefined); - const ismutual: boolean = (!!mutualfollows?.length && mutualfollows.length > 0) + const youFollowThemRes = useGetFollowState({ + target: identity?.did ?? targetdidorhandle, + user: agent?.did, + }); + + const theyFollowYou: boolean = (!!theyFollowYouRes?.length && theyFollowYouRes.length > 0) + const youFollowThem: boolean = (!!youFollowThemRes?.length && youFollowThemRes.length > 0) return ( <> + {/* if not self */} {identity?.did !== agent?.did ? ( <> - {!(ismutual) ? ( - <> + {(theyFollowYou) ? ( + <> + {youFollowThem ? ( +
mutuals
+ ) : ( +
follows you
+ ) + } + ) : ( -
mutuals
+ <> )} ) : ( -- 2.51.2