diff --git a/components/form.js b/components/form.js index 425ee255..4144f771 100644 --- a/components/form.js +++ b/components/form.js @@ -802,7 +802,8 @@ export function Form ({ } } catch (err) { const msg = err.message || err.toString?.() - // handle errors from JIT invoices by ignoring them + // ignore errors from JIT invoices or payments from attached wallets + // that mean that submit failed because user aborted the payment if (msg === 'modal closed' || msg === 'invoice canceled') return toaster.danger('submit error: ' + msg) } diff --git a/components/invoice.js b/components/invoice.js index a356e4c3..e8565e3f 100644 --- a/components/invoice.js +++ b/components/invoice.js @@ -293,13 +293,12 @@ export const useInvoiceable = (onSubmit, options = defaultOptions) => { return onSubmitWrapper } -const INVOICE_CANCELED_ERROR = 'invoice was canceled' +const INVOICE_CANCELED_ERROR = 'invoice canceled' const waitForPayment = async ({ invoice, showModal, provider, pollInvoice, gqlCacheUpdate }) => { if (provider.enabled) { try { return await waitForWebLNPayment({ provider, invoice, pollInvoice, gqlCacheUpdate }) } catch (err) { - const INVOICE_CANCELED_ERROR = 'invoice was canceled' // check for errors which mean that QR code will also fail if (err.message === INVOICE_CANCELED_ERROR) { throw err