Skip to content

Commit

Permalink
🐛 Fix missing wnft status in claim page
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Nov 27, 2024
1 parent c2eae81 commit 0c77c0d
Showing 1 changed file with 46 additions and 27 deletions.
73 changes: 46 additions & 27 deletions src/pages/nft/claim/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ import {
import {
postStripeFiatPendingClaim,
getNFTBookClaimEndpoint,
getStripeFiatPaymentStatus,
getNFTBookPaymentStatusEndpoint,
getFreeNFTBookPurchaseEndpoint,
getNFTBookCartStatusEndpoint,
Expand Down Expand Up @@ -802,6 +803,7 @@ export default {
!newValue &&
!(
this.status === 'completed' ||
this.status === 'done' ||
this.status === 'pending' ||
this.status === 'pendingNFT'
)
Expand Down Expand Up @@ -854,33 +856,49 @@ export default {
this.giftInfo = giftInfo;
if (query.type === 'nft_book') this.clearBookProductShoppingCart();
} else if (this.paymentId) {
try {
const { data } = await this.$api.get(
getNFTBookPaymentStatusEndpoint({
classId: this.classId,
collectionId: this.collectionId,
paymentId: this.paymentId,
token: this.token,
})
);
({ price, priceIndex } = data);
const {
giftInfo,
isPhysicalOnly,
status,
autoMemo,
isAutoDeliver,
quantity,
} = data;
this.giftInfo = giftInfo;
this.isPhysicalOnly = isPhysicalOnly;
this.isAutoDeliver = isAutoDeliver;
this.creatorMessage = parseAutoMemo(autoMemo);
this.status = status;
this.quantity = quantity;
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
if (this.isNFTBook) {
try {
const { data } = await this.$api.get(
getNFTBookPaymentStatusEndpoint({
classId: this.classId,
collectionId: this.collectionId,
paymentId: this.paymentId,
token: this.token,
})
);
({ price, priceIndex } = data);
const {
giftInfo,
isPhysicalOnly,
status,
autoMemo,
isAutoDeliver,
quantity,
} = data;
this.giftInfo = giftInfo;
this.isPhysicalOnly = isPhysicalOnly;
this.isAutoDeliver = isAutoDeliver;
this.creatorMessage = parseAutoMemo(autoMemo);
this.status = status;
this.quantity = quantity;
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
}
} else {
try {
const { data } = await this.$api.get(
getStripeFiatPaymentStatus({
paymentId: this.paymentId,
token: this.token,
})
);
this.status = data.status;
price = data.fiatPrice;
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
}
}
} else {
// free purchase?
Expand Down Expand Up @@ -1004,6 +1022,7 @@ export default {
if (
this.status === 'completed' ||
this.status === 'done' ||
this.status === 'pending' ||
this.status === 'pendingNFT'
) {
Expand Down

0 comments on commit 0c77c0d

Please sign in to comment.