Skip to content

Commit

Permalink
🐛 Fix the missing txHash
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Mar 19, 2024
1 parent 290c47d commit a9fc7d9
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,6 @@ export default class IscnUploadForm extends Vue {
// TODO: Handle error
// eslint-disable-next-line no-console
console.error(err);
} finally {
this.uploadStatus = '';
}
return '';
}
Expand Down Expand Up @@ -866,18 +864,22 @@ export default class IscnUploadForm extends Vue {
if (IMAGE_MIME_TYPES.includes(file.fileType)) {
const existingData =
this.sentArweaveTransactionInfo.get(file.ipfsHash) || {}
const { transactionHash, arweaveId: uploadArweaveId } = existingData
if (uploadArweaveId) {
this.addToEpubMetadataList(transactionHash as string, uploadArweaveId)
if (existingData.arweaveId) {
this.addToEpubMetadataList(file.ipfsHash, existingData.arweaveId)
return
}
const transactionHash =
// eslint-disable-next-line no-await-in-loop
existingData.transactionHash || (await this.sendArweaveFeeTx(file))
// eslint-disable-next-line no-await-in-loop
const arweaveId = await this.uploadFileAndGetArweaveId(
file,
transactionHash as string,
transactionHash,
)
if (arweaveId) {
this.addToEpubMetadataList(file.ipfsHash, arweaveId)
this.sentArweaveTransactionInfo.set(file.ipfsHash, { transactionHash, arweaveId });
return
}
return
Expand All @@ -887,9 +889,6 @@ export default class IscnUploadForm extends Vue {
async onSubmit() {
if (IS_CHAIN_UPGRADING) return
if (this.checkUploadFileTypeIsPDF()) {
await this.setEbookCoverFromImages()
}
logTrackerEvent(this, 'ISCNCreate', 'ClickUpload', '', 1);
this.uploadStatus = 'uploading'
this.error = ''
Expand All @@ -912,6 +911,11 @@ export default class IscnUploadForm extends Vue {
try {
this.uploadStatus = 'uploading';
if (this.checkUploadFileTypeIsPDF()) {
await this.setEbookCoverFromImages()
}
// eslint-disable-next-line no-restricted-syntax
this.numberOfSignNeeded = this.modifiedFileRecords.length;
this.signProgress = 0;
Expand Down

0 comments on commit a9fc7d9

Please sign in to comment.