From e6b51f29ce0bc9ed571bc4904102c7859fd0893e Mon Sep 17 00:00:00 2001 From: silverpill Date: Thu, 12 Jan 2023 00:54:28 +0000 Subject: [PATCH] Stop loading if monero subscription setup fails --- src/components/SubscriptionSettingsMonero.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/SubscriptionSettingsMonero.vue b/src/components/SubscriptionSettingsMonero.vue index 57d8bb2..eca5479 100644 --- a/src/components/SubscriptionSettingsMonero.vue +++ b/src/components/SubscriptionSettingsMonero.vue @@ -127,11 +127,17 @@ function isFormValid(): boolean { async function saveSubscriptionSettings() { isLoading = true - const user = await registerMoneroSubscriptionOption( - ensureAuthToken(), - getPricePerSec(subscriptionPrice), - subscriptionPayoutAddress, - ) + let user + try { + user = await registerMoneroSubscriptionOption( + ensureAuthToken(), + getPricePerSec(subscriptionPrice), + subscriptionPayoutAddress, + ) + } catch (error: any) { + isLoading = false + return + } setCurrentUser(user) await loadSubscriptionSettings() isFormVisible = false