This commit is contained in:
debu-2 2026-10-14 06:04:27 +05:30
parent 84544e1153
commit a109df2deb
7 changed files with 51 additions and 11 deletions

View file

@ -137,7 +137,9 @@ export function CustomerWhatsAppInbox({ account, onBack }: { account: WhatsAppAc
useEffect(() => {
Promise.all([
whatsappApi.messages(account.id),
whatsappApi.templates(account.id).catch(() => ({ available: false, templates: [] as WhatsAppTemplateRow[] })),
account.status === 'disconnected'
? Promise.resolve({ available: false, templates: [] as WhatsAppTemplateRow[] })
: whatsappApi.templates(account.id).catch(() => ({ available: false, templates: [] as WhatsAppTemplateRow[] })),
])
.then(([items, templatePayload]) => {
setMessages(items)