From 9d79ae1e0a17e7bfc2caf2538e0821d5b1eec63f Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 7 Aug 2024 17:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Change=20control=20bar=20price?= =?UTF-8?q?=20according=20to=20index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/nft.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mixins/nft.js b/src/mixins/nft.js index fb2dfd807..f51f3052e 100644 --- a/src/mixins/nft.js +++ b/src/mixins/nft.js @@ -435,6 +435,7 @@ export default { priceLabel, price, value: index, + index, stock, style, isAllowCustomPrice, @@ -447,7 +448,7 @@ export default { : [defaultEdition]; }, editionPriceIndex() { - if (this.priceIndex !== undefined) return this.priceIndex; + if (this.priceIndex !== undefined) return Number(this.priceIndex); if (!this.nftIsNFTBook) return undefined; return Number(this.$route.query.price_index) || 0; }, @@ -483,8 +484,16 @@ export default { }); }, nftBookAvailablePriceLabel() { - const purchasePrice = this.nftEditions.find(item => item.stock > 0) - ?.priceLabel; + let edition; + if (this.editionPriceIndex !== undefined) { + edition = this.nftEditions.find( + e => e.index === this.editionPriceIndex + ); + } + if (!edition) { + edition = this.nftEditions.find(item => item.stock > 0); + } + const purchasePrice = edition?.priceLabel; return purchasePrice; }, nftMustClaimToView() {