From d7c5b0d8ffe4ac8fba182328a91deb69f14ce608 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Tue, 30 Jun 2026 08:08:20 +0100 Subject: [PATCH] Wait for wave huddle agent lookup --- .../messages/ui/WaveMessageAttachment.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/desktop/src/features/messages/ui/WaveMessageAttachment.tsx b/desktop/src/features/messages/ui/WaveMessageAttachment.tsx index a585cb7bb..a68c686e7 100644 --- a/desktop/src/features/messages/ui/WaveMessageAttachment.tsx +++ b/desktop/src/features/messages/ui/WaveMessageAttachment.tsx @@ -53,16 +53,26 @@ export function WaveMessageAttachment({ return true; }); }, [huddleMemberPubkeys, targetAgentPubkey]); + const resolvedIncludesTarget = + normalizedTargetPubkey !== null && + resolvedHuddleMemberPubkeys.some( + (pubkey) => normalizePubkey(pubkey) === normalizedTargetPubkey, + ); const targetAgentLookupPending = - targetIsAgent && normalizedTargetPubkey !== null && huddleMemberPubkeysPending && targetAgentPubkey === null && - !resolvedHuddleMemberPubkeys.some( - (pubkey) => normalizePubkey(pubkey) === normalizedTargetPubkey, - ); + !resolvedIncludesTarget; + const legacyAgentLookupPending = + normalizedTargetPubkey === null && + !targetIsAgent && + huddleMemberPubkeysPending && + resolvedHuddleMemberPubkeys.length === 0; const startHuddleDisabled = - !channelId || isStarting || targetAgentLookupPending; + !channelId || + isStarting || + targetAgentLookupPending || + legacyAgentLookupPending; const handleStartHuddle = React.useCallback( async (event: React.MouseEvent) => {