mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Wait for profile agent lookup before waving
This commit is contained in:
@@ -204,14 +204,24 @@ export function UserProfilePopover({
|
||||
(a) => a.pubkey === pubkey,
|
||||
);
|
||||
const isBotProfile = role === "bot" || Boolean(relayAgent || managedAgent);
|
||||
const normalizedProfilePubkey = normalizePubkey(pubkey);
|
||||
const profileAgentSummary =
|
||||
usersBatchQuery.data?.profiles[normalizedProfilePubkey];
|
||||
const isProfileAgentLookupPending =
|
||||
open &&
|
||||
role !== "bot" &&
|
||||
!isBotProfile &&
|
||||
(usersBatchQuery.isPending ||
|
||||
usersBatchQuery.isPlaceholderData ||
|
||||
(usersBatchQuery.isFetching && profileAgentSummary === undefined));
|
||||
const isAgentClassificationPending =
|
||||
open &&
|
||||
role !== "bot" &&
|
||||
(relayAgentsQuery.isPending || managedAgentsQuery.isPending);
|
||||
(relayAgentsQuery.isPending ||
|
||||
managedAgentsQuery.isPending ||
|
||||
isProfileAgentLookupPending);
|
||||
const profile = profileQuery.data;
|
||||
const isAgentByProfile = Boolean(
|
||||
usersBatchQuery.data?.profiles[normalizePubkey(pubkey)]?.isAgent,
|
||||
);
|
||||
const isAgentByProfile = Boolean(profileAgentSummary?.isAgent);
|
||||
const isAgentTarget = isBotProfile || isAgentByProfile;
|
||||
const displayName = profile?.displayName ?? truncatePubkey(pubkey);
|
||||
// Owner signal mirrors UserProfilePanel: a declared NIP-OA owner whose agent
|
||||
|
||||
Reference in New Issue
Block a user