diff --git a/components/bsx/Create/CreateCollection.vue b/components/bsx/Create/CreateCollection.vue index 79a2870700..d56522b04a 100644 --- a/components/bsx/Create/CreateCollection.vue +++ b/components/bsx/Create/CreateCollection.vue @@ -50,6 +50,12 @@ import { BaseCollectionType } from '@/composables/transaction/types' import shouldUpdate from '@/utils/shouldUpdate' import { Token, getBalance, getDeposit, getFeesToken } from './utils' import { NeoField } from '@kodadot1/brick' +import Loader from '@/components/shared/Loader.vue' +import BaseCollectionForm from '@/components/base/BaseCollectionForm.vue' +import SubmitButton from '@/components/base/SubmitButton.vue' +import Money from '@/components/bsx/format/TokenMoney.vue' +import AccountBalance from '@/components/shared/AccountBalance.vue' +import MultiPaymentFeeButton from '@/components/bsx/specific/MultiPaymentFeeButton.vue' const emit = defineEmits(['created']) @@ -60,15 +66,6 @@ const { urlPrefix, tokenId } = usePrefix() const { status: transactionStatus, isLoading: isTransactionLoading } = useTransactionStatus() -const Loader = () => import('@/components/shared/Loader.vue') -const BaseCollectionForm = () => - import('@/components/base/BaseCollectionForm.vue') -const SubmitButton = () => import('@/components/base/SubmitButton.vue') -const Money = () => import('@/components/bsx/format/TokenMoney.vue') -const AccountBalance = () => import('@/components/shared/AccountBalance.vue') -const MultiPaymentFeeButton = () => - import('@/components/bsx/specific/MultiPaymentFeeButton.vue') - const base = ref({ name: '', file: null, @@ -102,6 +99,19 @@ const depositOfToken = computed(() => getDeposit(feesToken.value, parseFloat(collectionDeposit.value)) ) +const { transaction, status, isLoading, blockNumber } = useTransaction() +watch([isLoading, status], () => { + isTransactionLoading.value = isLoading.value + if (Boolean(status.value)) { + transactionStatus.value = status.value + } +}) +watch(blockNumber, (block) => { + if (block) { + emit('created') + } +}) + async function submit(): Promise { // check fields if (!checkValidity()) { @@ -118,19 +128,6 @@ async function submit(): Promise { isTransactionLoading.value = true transactionStatus.value = 'loader.checkBalance' - const { transaction, status, isLoading, blockNumber } = useTransaction() - watch([isLoading, status], () => { - isTransactionLoading.value = isLoading.value - if (Boolean(status.value)) { - transactionStatus.value = status.value - } - }) - watch(blockNumber, (block) => { - if (block) { - emit('created') - } - }) - try { showNotification( $i18n.t('mint.creatingCollection', { name: base.value.name }),