Show error message if invoice can not be created

This commit is contained in:
silverpill 2023-03-30 11:55:29 +00:00
parent 7ab85991db
commit a90cd5cb20
2 changed files with 12 additions and 5 deletions

View file

@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed ### Changed
- Don't revoke auth token when handling timeline loading error. - Don't revoke auth token when handling timeline loading error.
- Show error message if invoice can not be created.
## [1.18.0] - 2023-03-21 ## [1.18.0] - 2023-03-21

View file

@ -242,11 +242,17 @@ async function onCreateInvoice() {
return return
} }
isLoading = true isLoading = true
try {
invoice = await createInvoice( invoice = await createInvoice(
sender.id, sender.id,
recipient.id, recipient.id,
paymentAmount, paymentAmount,
) )
} catch (error: any) {
alert(error.message)
isLoading = false
return
}
// Add invoice ID to current URL // Add invoice ID to current URL
window.history.pushState( window.history.pushState(
{}, {},