Skip to content

Commit

Permalink
🚸 Change control bar price according to index
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Aug 8, 2024
1 parent 20f0840 commit 9d79ae1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export default {
priceLabel,
price,
value: index,
index,
stock,
style,
isAllowCustomPrice,
Expand All @@ -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;
},
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 9d79ae1

Please sign in to comment.