File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
components/dashboard/chart Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ import { getGroupLabel } from '~/utils/dashboard/group'
1414const { t : $t } = useTranslation ()
1515const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore ()
1616const {
17- hasAbilityCharthistory,
1817 overview,
1918} = storeToRefs (validatorDashboardOverviewStore )
19+ const { hasAbilityChartHistory } = useUserStore ()
2020
2121const chartFilter = defineModel <SummaryChartFilter >({ required: true })
2222
@@ -25,7 +25,7 @@ const aggregation = ref<AggregationTimeframe>(chartFilter.value.aggregation)
2525
2626const aggregationList = computed (() => {
2727 return AggregationTimeframes .map (timeframe => ({
28- disabled: ! hasAbilityCharthistory .value [timeframe ],
28+ disabled: ! hasAbilityChartHistory .value [timeframe ],
2929 id: timeframe ,
3030 label: $t (` time_frames.${timeframe } ` ),
3131 }))
Original file line number Diff line number Diff line change @@ -73,13 +73,6 @@ export const useValidatorDashboardOverviewStore = defineStore('validator-dashboa
7373 )
7474 } )
7575
76- const hasAbilityCharthistory = computed ( ( ) => ( {
77- daily : ( overview . value ?. chart_history_seconds ?. daily ?? 0 ) > 0 ,
78- epoch : ( overview . value ?. chart_history_seconds ?. epoch ?? 0 ) > 0 ,
79- hourly : ( overview . value ?. chart_history_seconds ?. hourly ?? 0 ) > 0 ,
80- weekly : ( overview . value ?. chart_history_seconds ?. weekly ?? 0 ) > 0 ,
81- } ) )
82-
8376 const isLargeDashboard = computed ( ( ) => {
8477 if ( ! validatorCount . value ) return false
8578
@@ -90,7 +83,6 @@ export const useValidatorDashboardOverviewStore = defineStore('validator-dashboa
9083 } )
9184
9285 return {
93- hasAbilityCharthistory,
9486 hasValidators,
9587 isLargeDashboard,
9688 loading,
Original file line number Diff line number Diff line change @@ -50,9 +50,25 @@ export function useUserStore() {
5050
5151 const premium_perks = computed ( ( ) => user . value ?. premium_perks )
5252
53+ const hasAbilityRewardsChartHistory = computed ( ( ) => ( {
54+ daily : ( user . value ?. premium_perks . rewards_chart_history_seconds ?. daily ?? 0 ) > 0 ,
55+ epoch : ( user . value ?. premium_perks . rewards_chart_history_seconds ?. epoch ?? 0 ) > 0 ,
56+ hourly : ( user . value ?. premium_perks . rewards_chart_history_seconds ?. hourly ?? 0 ) > 0 ,
57+ weekly : ( user . value ?. premium_perks . rewards_chart_history_seconds ?. weekly ?? 0 ) > 0 ,
58+ } ) )
59+
60+ const hasAbilityChartHistory = computed ( ( ) => ( {
61+ daily : ( user . value ?. premium_perks . chart_history_seconds ?. daily ?? 0 ) > 0 ,
62+ epoch : ( user . value ?. premium_perks . chart_history_seconds ?. epoch ?? 0 ) > 0 ,
63+ hourly : ( user . value ?. premium_perks . chart_history_seconds ?. hourly ?? 0 ) > 0 ,
64+ weekly : ( user . value ?. premium_perks . chart_history_seconds ?. weekly ?? 0 ) > 0 ,
65+ } ) )
66+
5367 return {
5468 doLogout,
5569 getUser,
70+ hasAbilityChartHistory,
71+ hasAbilityRewardsChartHistory,
5672 hasV1Notifications,
5773 isLoggedIn,
5874 premium_perks,
You can’t perform that action at this time.
0 commit comments