Skip to content

Commit

Permalink
web/satellite: fixed low token balance banner blink
Browse files Browse the repository at this point in the history
Added isLoading flag to not show banner until all the requests are resolved.

Issue:
#6831

Change-Id: I71c1a4e335d376d10c7305bac879735d7b8d5f8f
  • Loading branch information
VitaliiShpital authored and Storj Robot committed Mar 15, 2024
1 parent ac1d5df commit 8a323ce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/satellite/src/views/Projects.vue
Expand Up @@ -6,7 +6,7 @@
<trial-expiration-banner v-if="isTrialExpirationBanner" :expired="isExpired" />

<low-token-balance-banner
v-if="isLowBalance && billingEnabled"
v-if="!isLoading && isLowBalance && billingEnabled"
cta-label="Go to billing"
@click="redirectToBilling"
/>
Expand Down Expand Up @@ -144,6 +144,7 @@ const isJoinProjectDialogShown = ref<boolean>(false);
const isCreateProjectDialogShown = ref<boolean>(false);
const addMemberProjectId = ref<string>('');
const isAddMemberDialogShown = ref<boolean>(false);
const isLoading = ref<boolean>(true);
/**
* Indicates if billing features are enabled.
Expand Down Expand Up @@ -241,13 +242,15 @@ function formattedValue(value: Size): string {
}
}
onMounted(() => {
onMounted(async () => {
if (configStore.state.config.nativeTokenPaymentsEnabled && billingEnabled.value) {
Promise.all([
await Promise.all([
billingStore.getBalance(),
billingStore.getCreditCards(),
billingStore.getNativePaymentsHistory(),
]).catch(_ => {});
}
isLoading.value = false;
});
</script>

0 comments on commit 8a323ce

Please sign in to comment.