Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: paid mint modal stuck on loading #10798

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions stores/identity.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { type Registration } from '@polkadot/types/interfaces/identity/types'
import { defineStore } from 'pinia'
import type { Prefix } from '@kodadot1/static'
import { type Prefix, chainList } from '@kodadot1/static'
import { emptyObject } from '@/utils/empty'
import { networkToPrefix } from '@/composables/useMultipleBalance'
import { vmOf } from '@/utils/config/chain.config'

const DEFAULT_BALANCE_STATE = {
ksm: '0',
Expand Down Expand Up @@ -142,14 +143,19 @@ export const useIdentityStore = defineStore('identity', {
const { isTestnet } = usePrefix()
const { multiBalanceAssets, multiBalanceAssetsTestnet }
= storeToRefs(useIdentityStore())
const { availableChainsByVm } = useChain()
const { vm } = useChain()

// useChain().availableChainsByVm excludes disabled chains like dot
const vmChains = chainList().filter(
({ value: prefix }) => vm.value === vmOf(prefix as Prefix),
)

const assets = isTestnet
? multiBalanceAssetsTestnet.value
: multiBalanceAssets.value

return assets.filter(asset =>
availableChainsByVm.value
vmChains
.map(chain => chain.value)
.includes(networkToPrefix[asset.chain] as ChainType),
)
Expand Down
Loading