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
+ <> )} ) : (