diff --git a/components/rmrk/Create/CreateToken.vue b/components/rmrk/Create/CreateToken.vue index 4add2395a1..730ba0737c 100644 --- a/components/rmrk/Create/CreateToken.vue +++ b/components/rmrk/Create/CreateToken.vue @@ -269,8 +269,18 @@ export default class CreateToken extends mixins( } watch([blockNumber, createdNFTs], () => { - if (this.hasPrice) { - if (blockNumber.value && createdNFTs.value) { + if (blockNumber.value && createdNFTs.value) { + const isJustNftMint = !this.listed + if (isJustNftMint) { + setTimeout( + () => + this.handleCreatedNftsRedirect( + createdNFTs.value, + blockNumber.value as string + ), + 300 + ) + } else if (this.hasPrice) { setTimeout( () => this.listForSale( @@ -319,7 +329,6 @@ export default class CreateToken extends mixins( nftId: toNFTId(nft, originalBlockNumber), })) - const isSingle = list.length === 1 this.isLoading = true transaction({ interaction: Interaction.LIST, @@ -332,13 +341,7 @@ export default class CreateToken extends mixins( watch([isLoading, blockNumber], () => { if (!isLoading.value && blockNumber.value) { - this.navigateToDetail({ - pageId: isSingle - ? list[0].nftId - : (this.base.selectedCollection?.id as string), - nftName: this.base.name, - toCollectionPage: !isSingle, - }) + this.handleCreatedNftsRedirect(createdNFT, originalBlockNumber) } }) } catch (e) { @@ -346,6 +349,21 @@ export default class CreateToken extends mixins( } } + protected handleCreatedNftsRedirect( + createdNFT: CreatedNFT[] | CreatedNFTV2[], + originalBlockNumber: string + ) { + const nfts = createdNFT.map((nft) => toNFTId(nft, originalBlockNumber)) + + const isSingle = nfts.length === 1 + + this.navigateToDetail({ + pageId: isSingle ? nfts[0] : (this.base.selectedCollection?.id as string), + nftName: this.base.name, + toCollectionPage: !isSingle, + }) + } + protected async estimateTx() { // TODO: implement }