diff --git a/frontend/src/components/TradeBox/EncryptedChat/index.tsx b/frontend/src/components/TradeBox/EncryptedChat/index.tsx index 07df7d7e..e4f6dea4 100644 --- a/frontend/src/components/TradeBox/EncryptedChat/index.tsx +++ b/frontend/src/components/TradeBox/EncryptedChat/index.tsx @@ -72,11 +72,12 @@ const EncryptedChat: React.FC = ({ const sendToNostr = (content: string): void => { const slot = garage.getSlot(); const coordinator = federation.getCoordinator(order.shortAlias); + const publicKey = order.is_maker ? order.taker_nostr_pubkey : order.maker_nostr_pubkey; - if (!slot?.nostrSecKey) return; + if (!slot?.nostrSecKey || !publicKey) return; const recipient = { - publicKey: order.is_maker ? order.taker_nostr_pubkey : order.maker_nostr_pubkey, + publicKey, relayUrl: coordinator.getRelayUrl(settings.network), };