Skip to content

Commit 13f7f28

Browse files
marcel-bitflyenzo-bitfly
authored andcommitted
fix(dashboard): only show banner if maximum effective balance of dashboard is reached
See: BEDS-1462
1 parent 5f5066a commit 13f7f28

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

frontend/i18n/locales/en.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@
204204
"text": "Create your own dashboard to get the most out of beaconcha.in"
205205
},
206206
"subsciprion_limit_reached": {
207-
"_link": "Upgrade your subscription or get an add-on.",
208-
"template": "This dashboard exceeds your maximum stake limit, so you can't add more validators. {_link}"
207+
"_link": "Learn more about our subscription plans and dashboard addon-ons on our pricing page.",
208+
"template": "This dashboard exceeds the stake limit so no more validators can be added. {_link}"
209209
},
210210
"subsciprion_limit_reached_title": "Maximum stake exceeded",
211211
"table": {

frontend/pages/dashboard/[[id]]/index.vue

+1-16
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type { TableQueryParams } from '~/types/datatable'
1212
1313
const {
1414
isLoggedIn,
15-
premium_perks,
1615
} = useUserStore()
1716
const showInDevelopment = Boolean(useRuntimeConfig().public.showInDevelopment)
1817
const { t: $t } = useTranslation()
@@ -95,24 +94,10 @@ const {
9594
9695
const {
9796
getProducts,
98-
premiumProducts,
9997
} = useProductsStore()
10098
10199
await useAsyncData('get_products', () => getProducts())
102100
103-
const hasReachedLimit = computed(() => {
104-
const latestEffectiveBalance = overview.value?.balances.effective_latest
105-
const freeProduct = premiumProducts.value['Free']
106-
const effectiveBalanceLimitFreeProduct = freeProduct?.premium_perks.effective_balance_per_dashboard
107-
const effectiveBalancePerDashboard = premium_perks.value?.effective_balance_per_dashboard
108-
|| effectiveBalanceLimitFreeProduct
109-
110-
if (!latestEffectiveBalance || !effectiveBalancePerDashboard) {
111-
return false
112-
}
113-
return isGreaterEquals(latestEffectiveBalance, effectiveBalancePerDashboard)
114-
})
115-
116101
await useAsyncData('user_dashboards', () => refreshDashboards(), { watch: [ isLoggedIn ] })
117102
118103
const { error: validatorOverviewError } = await useAsyncData(
@@ -382,7 +367,7 @@ watch(
382367
<BcPageWrapper>
383368
<template #banner>
384369
<BcNotificationBanner
385-
v-if="hasReachedLimit"
370+
v-if=" overview?.is_above_effective_balance_limit"
386371
:title="$t('dashboard.subsciprion_limit_reached_title')"
387372
>
388373
<BcTranslation

0 commit comments

Comments
 (0)