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
- 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

View file

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