Skip to content

Commit 3b1b464

Browse files
committed
🔊 Improve toast error when whatsapp token is not valid
1 parent b6a31c2 commit 3b1b464

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/builder/src/features/publish/components/embeds/modals/WhatsAppModal/WhatsAppCredentialsModal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export const WhatsAppCredentialsModal = ({
158158
setIsVerifying(false)
159159
showToast({
160160
description: 'Could not get system info',
161+
details:
162+
err instanceof Error
163+
? { content: err.message, lang: 'json' }
164+
: undefined,
161165
})
162166
return false
163167
}
@@ -204,7 +208,10 @@ export const WhatsAppCredentialsModal = ({
204208
setIsVerifying(false)
205209
showToast({
206210
description: 'Could not get phone number info',
207-
details: { content: JSON.stringify(err), lang: 'json' },
211+
details:
212+
err instanceof Error
213+
? { content: err.message, lang: 'json' }
214+
: undefined,
208215
})
209216
return false
210217
}

0 commit comments

Comments
 (0)