Stop loading if monero subscription setup fails

This commit is contained in:
silverpill 2023-01-12 00:54:28 +00:00
parent 133cffa120
commit e6b51f29ce

View file

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