diff --git a/ui/pages/confirmation/confirmation.js b/ui/pages/confirmation/confirmation.js index 532dc8209..684737168 100644 --- a/ui/pages/confirmation/confirmation.js +++ b/ui/pages/confirmation/confirmation.js @@ -83,7 +83,7 @@ function useAlertState(pendingConfirmation) { let isMounted = true; if (pendingConfirmation) { getTemplateAlerts(pendingConfirmation).then((alerts) => { - if (isMounted && alerts) { + if (isMounted && alerts.length > 0) { dispatch({ type: 'set', confirmationId: pendingConfirmation.id, diff --git a/ui/pages/confirmation/templates/index.js b/ui/pages/confirmation/templates/index.js index a4e873735..8c9a6997f 100644 --- a/ui/pages/confirmation/templates/index.js +++ b/ui/pages/confirmation/templates/index.js @@ -43,7 +43,7 @@ const ALLOWED_TEMPLATE_KEYS = [ */ export async function getTemplateAlerts(pendingApproval) { const fn = APPROVAL_TEMPLATES[pendingApproval.type]?.getAlerts; - const results = fn ? await fn(pendingApproval) : undefined; + const results = fn ? await fn(pendingApproval) : []; if (!Array.isArray(results)) { throw new Error(`Template alerts must be an array, received: ${results}`); }