Skip to content

Commit

Permalink
feat: call wait after check if tx is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrom8 committed Mar 22, 2024
1 parent 4096845 commit 02fa4eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/@utils/dispenser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ export async function setMinterToPublisher(
accountId,
accountId
)
await removeMinterTx.wait()

if (!removeMinterTx) {
setError('Updating DDO failed.')
LoggerInstance.error('Failed at cancelMinter')
}

await removeMinterTx.wait()

return removeMinterTx
}

Expand All @@ -40,5 +42,7 @@ export async function setMinterToDispenser(
setError('Updating DDO failed.')
LoggerInstance.error('Failed at makeMinter')
}
await addMinterTx.wait()

return addMinterTx
}
1 change: 1 addition & 0 deletions src/components/Asset/Edit/EditComputeDataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default function EditComputeDataset({
LoggerInstance.error(content.form.error)
return
} else {
await setMetadataTx.wait()
if (asset.accessDetails.type === 'free') {
const tx = await setMinterToDispenser(
signer,
Expand Down
1 change: 1 addition & 0 deletions src/components/Asset/Edit/EditMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export default function Edit({
LoggerInstance.error(content.form.error)
return
} else {
await setMetadataTx.wait()
if (asset.accessDetails.type === 'free') {
const tx = await setMinterToDispenser(
signer,
Expand Down

0 comments on commit 02fa4eb

Please sign in to comment.