Skip to content

Commit

Permalink
🚨 fix prop check for email recipient status
Browse files Browse the repository at this point in the history
  • Loading branch information
foysalit committed Dec 11, 2024
1 parent 0494a12 commit 25f5024
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/email/useEmailRecipientStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 25f5024

Please sign in to comment.