diff --git a/src/assets/feather/refresh-ccw.svg b/src/assets/feather/refresh-ccw.svg new file mode 100644 index 0000000..95c4158 --- /dev/null +++ b/src/assets/feather/refresh-ccw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Subscription.vue b/src/components/Subscription.vue index b03bf0e..b8f31cf 100644 --- a/src/components/Subscription.vue +++ b/src/components/Subscription.vue @@ -61,10 +61,15 @@ v-if="tokenBalance !== null" class="token-balance" :class="{ error: !canPay() }" - @click="refreshTokenBalance()" > -
{{ subscription.formatAmount(tokenBalance) }} {{ subscription.tokenSymbol }}
+ + {{ subscription.formatAmount(tokenBalance) }} + + {{ subscription.tokenSymbol }} +
@@ -142,13 +147,15 @@ const recipientEthereumAddress = recipient.getVerifiedEthereumAddress() const sender = $ref(new ProfileWrapper(currentUser || guest)) let senderEthereumAddress = $ref(sender.getVerifiedEthereumAddress()) let { walletAddress, walletError, getSigner } = $(useWallet()) -let isLoading = $ref(false) let subscriptionConfigured = $ref(null) let subscription = $ref(null) let subscriptionState = $ref(null) let tokenBalance = $ref(null) const paymentDuration = $ref(1) +let isLoading = $ref(false) +let isTokenBalanceLoading = $ref(false) + onMounted(() => { if (walletAddress && !walletError) { // Load info immediately if wallet is already connected @@ -244,7 +251,9 @@ async function refreshTokenBalance() { return } const signer = getSigner() + isTokenBalanceLoading = true tokenBalance = await getTokenBalance(signer, subscription.tokenAddress) + isTokenBalanceLoading = false } async function onMakeSubscriptionPayment() { @@ -453,6 +462,16 @@ async function onCancelSubscription() { .token-balance { color: $secondary-text-color; + output.loading { + opacity: 0.5; + } + + img { + filter: $secondary-text-colorizer; + height: 1em; + min-width: 1em; + } + &.error { color: $text-color; }