tangled
alpha
login
or
join now
whey.party
/
red-dwarf
82
fork
atom
an independent Bluesky client using Constellation, PDS Queries, and other services
reddwarf.app
frontend
spa
bluesky
reddwarf
microcosm
client
app
82
fork
atom
overview
issues
25
pulls
pipelines
actual mutuals indicator
rimar1337
4 months ago
b3faaa61
37d24d0e
+19
-5
1 changed file
expand all
collapse all
unified
split
src
routes
profile.$did
index.tsx
+19
-5
src/routes/profile.$did/index.tsx
···
286
const {agent} = useAuth()
287
const {data: identity} = useQueryIdentity(targetdidorhandle);
288
289
-
const mutualfollows = useGetOneToOneState(agent?.did ? {
290
target: agent?.did,
291
user: identity?.did ?? targetdidorhandle,
292
collection: "app.bsky.graph.follow",
293
path: ".subject"
294
}:undefined);
295
296
-
const ismutual: boolean = (!!mutualfollows?.length && mutualfollows.length > 0)
0
0
0
0
0
0
297
298
return (
299
<>
0
300
{identity?.did !== agent?.did ? (
301
<>
302
-
{!(ismutual) ? (
303
-
<></>
0
0
0
0
0
0
0
304
) : (
305
-
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">mutuals</div>
306
)}
307
</>
308
) : (
···
286
const {agent} = useAuth()
287
const {data: identity} = useQueryIdentity(targetdidorhandle);
288
289
+
const theyFollowYouRes = useGetOneToOneState(agent?.did ? {
290
target: agent?.did,
291
user: identity?.did ?? targetdidorhandle,
292
collection: "app.bsky.graph.follow",
293
path: ".subject"
294
}:undefined);
295
296
+
const youFollowThemRes = useGetFollowState({
297
+
target: identity?.did ?? targetdidorhandle,
298
+
user: agent?.did,
299
+
});
300
+
301
+
const theyFollowYou: boolean = (!!theyFollowYouRes?.length && theyFollowYouRes.length > 0)
302
+
const youFollowThem: boolean = (!!youFollowThemRes?.length && youFollowThemRes.length > 0)
303
304
return (
305
<>
306
+
{/* if not self */}
307
{identity?.did !== agent?.did ? (
308
<>
309
+
{(theyFollowYou) ? (
310
+
<>
311
+
{youFollowThem ? (
312
+
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">mutuals</div>
313
+
) : (
314
+
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">follows you</div>
315
+
)
316
+
}
317
+
</>
318
) : (
319
+
<></>
320
)}
321
</>
322
) : (