Skip to content

Commit

Permalink
🥅 Ensure owners are fetched if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Feb 17, 2025
1 parent 099f3f1 commit 119ed20
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/pages/nft/claim/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1434,17 +1434,27 @@ export default {
this.getNFTClassOwnerInfoById(this.classId)[this.claimingAddress]
?.length || 0;
if (!collectedNFTs?.some(item => item.classId === this.classId)) {
if (
!collectedNFTs?.some(item => item.classId === this.classId) ||
!ownCount
) {
for (let attempts = 0; attempts < MAX_ATTEMPT; attempts += 1) {
try {
// eslint-disable-next-line no-await-in-loop
await Promise.all([
const fetchPromises = [
this.fetchCollectedNFTClassesByAddress({
address: this.claimingAddress,
nocache: true,
}),
this.fetchNFTOwners({ classId: this.classId, nocache: true }),
]);
];
if (ownCount === 0) {
fetchPromises.push(
this.fetchNFTOwners({ classId: this.classId, nocache: true })
);
}
// eslint-disable-next-line no-await-in-loop
await Promise.all(fetchPromises);
collectedNFTs = this.getCollectedNFTClassesByAddress(
this.claimingAddress
Expand Down

0 comments on commit 119ed20

Please sign in to comment.