From 25f5024d4552b36c7ba5a78267f22e5e9e50ec77 Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Wed, 11 Dec 2024 18:43:58 +0000 Subject: [PATCH] :rotating_light: fix prop check for email recipient status --- components/email/useEmailRecipientStatus.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/email/useEmailRecipientStatus.tsx b/components/email/useEmailRecipientStatus.tsx index 84e7fe1c..16d338c5 100644 --- a/components/email/useEmailRecipientStatus.tsx +++ b/components/email/useEmailRecipientStatus.tsx @@ -3,11 +3,13 @@ import { resolveDidDocData } from '@/lib/identity' import { useQuery } from '@tanstack/react-query' export const useEmailRecipientStatus = ( - did: string, + did?: string, ): { isLoading: boolean; error: any; cantReceive: boolean } => { const { data, isLoading, error } = useQuery({ queryKey: ['email-capability-check', did], queryFn: async () => { + // If no did is provided, we can't check if the recipient can receive emails + if (!did) return true const response = await resolveDidDocData(did) if (!response?.services) { return false