Skip to content

Commit

Permalink
Merge pull request gobitfly#575 from gobitfly/NOBIDS/ImproveDashboard…
Browse files Browse the repository at this point in the history
…CreationButtonStates

Nobids/improve dashboard creation button states
  • Loading branch information
D13ce authored Jul 10, 2024
2 parents 04d2d87 + 272edbb commit 067aff4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ChainIDs } from '~/types/network'
import { API_PATH } from '~/types/customFetch'
const { createValidatorDashboard, createAccountDashboard } = useUserDashboardStore()
const showInDevelopment = Boolean(useRuntimeConfig().public.showInDevelopment)
const { dashboards } = useUserDashboardStore()
const { user, isLoggedIn } = useUserStore()
Expand All @@ -30,7 +29,10 @@ const maxDashboards = computed(() => {
return user.value?.premium_perks.validator_dashboards ?? 1
})
const accountsDisabled = computed(() => {
return !showInDevelopment || (dashboards.value?.account_dashboards?.length ?? 0) >= maxDashboards.value
// TODO: Once account dashboards are being tackled, use something like
// return !showInDevelopment || (dashboards.value?.account_dashboards?.length ?? 0) >= maxDashboards.value
return true
})
const validatorsDisabled = computed(() => {
return (dashboards.value?.validator_dashboards?.length ?? 0) >= maxDashboards.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useNetworkStore } from '~/stores/useNetworkStore'
const { t: $t } = useI18n()
const { currentNetwork, isMainNet } = useNetworkStore()
const { isMainNet } = useNetworkStore()
const network = defineModel<ChainIDs>('network')
const selection = ref<`${ChainIDs}` | ''>('')
Expand All @@ -32,7 +32,7 @@ const showNameOrDescription = (chainId: ChainIDs): string => {
const buttonList = ValidatorDashboardNetworkList.map((chainId) => {
// TODO: simply set `false` for everything once dashboards can be created for all the networks in `ValidatorDashboardNetworkList`
const isDisabled = !useRuntimeConfig().public.showInDevelopment && chainId !== currentNetwork.value
const isDisabled = chainId !== ChainIDs.Ethereum
return {
value: String(chainId),
text: ChainInfo[chainId].family as string,
Expand Down

0 comments on commit 067aff4

Please sign in to comment.