From a90cd5cb20753e83ad74b932ff3a278a1216270e Mon Sep 17 00:00:00 2001 From: silverpill Date: Thu, 30 Mar 2023 11:55:29 +0000 Subject: [PATCH] Show error message if invoice can not be created --- CHANGELOG.md | 1 + src/components/SubscriptionMonero.vue | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15b4308..977dd84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/components/SubscriptionMonero.vue b/src/components/SubscriptionMonero.vue index 4fb8018..0f0ccc7 100644 --- a/src/components/SubscriptionMonero.vue +++ b/src/components/SubscriptionMonero.vue @@ -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( {},