Skip to content

Commit

Permalink
Merge pull request #20 from ziboilihua/main
Browse files Browse the repository at this point in the history
Adjust mint flag
  • Loading branch information
XueMoMo authored Sep 11, 2024
2 parents 0426698 + 6fad94d commit b5229a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
13 changes: 3 additions & 10 deletions components/mint/MintStep2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,21 @@ function PreMetadata(p: { onContinue: OnNext }) {
let taskRes: MintState = null;
while (true) {
if (!refSafe.safe) break;
await sleep(10000);
await sleep(2000);
taskRes = await axios
.get<Res<MintState>>(genUrl(`/auth/bucket/uuid/${mintData.uuid}`), {
headers: { Authorization: `Bearer ${auth}` },
})
.then(getResData)
.catch(() => null);
if (taskRes && taskRes.metadataTxHash) {
if (taskRes && taskRes.mintState >= 3) {
break;
}
}
if (!refSafe.safe) return;
updateMint({
metadata: taskRes.metadata,
metadataCID: taskRes.metadataCid,
metadataTX: taskRes.metadataTxHash,
});
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -225,12 +224,6 @@ function PreMetadata(p: { onContinue: OnNext }) {
<TupleInfo
data={["IPFS CID", shortStr(mintData.metadataCID, 10, 10)]}
/>
<TupleInfo
data={[
"Crust Network Storage Order TXID",
shortStr(mintData.metadataTX, 10, 10),
]}
/>
<TupleInfo data={["IPNS", shortStr(mintData.ipns, 10, 10)]} />
<TupleInfo data={["Storage Protocol", "Crust"]} />
</div>
Expand Down Expand Up @@ -304,7 +297,7 @@ export const MintStep2 = React.memo((p: MintStep2Props) => {
{
bucketInfo: JSON.stringify({
chainId: mintData.chainId,
editionId: mintData.editionId
editionId: mintData.editionId
})
},
{
Expand Down
2 changes: 1 addition & 1 deletion components/mint/MintStep3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const MintStep3 = React.memo((p: MintStep3Props) => {
if (taskRes && taskRes.tokenId && taskRes.mintTxHash) {
break;
}
await sleep(10000);
await sleep(3000);
}
updateMint({ mintTx: taskRes.mintTxHash, tokenId: taskRes.tokenId });
onNext();
Expand Down
3 changes: 1 addition & 2 deletions components/pages/main/Mint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ export const Mint = React.memo(() => {
updateMint({
metadata: mintstate.metadata,
ipns: mintstate.ipnsId,
metadataTX: mintstate.metadataTxHash,
metadataCID: mintstate.metadataCid,
mintTx: mintstate.mintTxHash,
tokenId: mintstate.tokenId,
editionId,
});
if (mintstate.mintTxHash) {
setStep(2);
} else if (mintstate.metadataTxHash) {
} else if (mintstate.mintState >= 3) {
setStep(1);
} else {
setStep(0);
Expand Down

0 comments on commit b5229a5

Please sign in to comment.