Skip to content

fix: show error banner when NEXT_PUBLIC_MOONPAY_API_KEY is unset (#178)#184

Merged
portableDD merged 1 commit into
Nexacore-Org:mainfrom
JoesWalker:fix/moonpay-silent-failure
May 30, 2026
Merged

fix: show error banner when NEXT_PUBLIC_MOONPAY_API_KEY is unset (#178)#184
portableDD merged 1 commit into
Nexacore-Org:mainfrom
JoesWalker:fix/moonpay-silent-failure

Conversation

@JoesWalker
Copy link
Copy Markdown
Contributor

PR Description:

Closes #178

Problem

When NEXT_PUBLIC_MOONPAY_API_KEY is not set, clicking "Buy Crypto (via MoonPay)" silently returned with no user feedback — no error, no toast, no
visual change.

Fix

  • Added moonPayError state to components/dashboard/deposit.tsx
  • handleMoonPayOpen now calls setMoonPayError(true) instead of silently returning when the API key is missing
  • An inline error banner is rendered above the deposit method cards in both desktop and mobile views when the error state is set
  • No new dependencies introduced — banner uses the existing red-tinted styling pattern consistent with the codebase
  • Happy path (when key IS set) is unchanged

Testing

  • With NEXT_PUBLIC_MOONPAY_API_KEY unset: clicking MoonPay shows the error banner
  • With NEXT_PUBLIC_MOONPAY_API_KEY set: MoonPay opens normally, no banner shown
  • TypeScript: tsc --noEmit passes with no errors

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@JoesWalker Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@portableDD portableDD merged commit 7bf3a58 into Nexacore-Org:main May 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wave 100pts] Fix: MoonPay deposit button silently does nothing when NEXT_PUBLIC_MOONPAY_API_KEY is unset — add user-facing error or disabled state

2 participants