From d8660fc4435ead25f0489fa7195eafa108ca199a Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Tue, 19 Mar 2024 21:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20the=20loading=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/IscnUploadForm.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/IscnUploadForm.vue b/components/IscnUploadForm.vue index 10e1b50f..8a7be313 100644 --- a/components/IscnUploadForm.vue +++ b/components/IscnUploadForm.vue @@ -750,7 +750,6 @@ export default class IscnUploadForm extends Vue { if (!this.signer) throw new Error('SIGNER_NOT_INITED'); if (!this.arweaveFeeTargetAddress) throw new Error('TARGET_ADDRESS_NOT_SET'); if (!this.arweaveFeeMap[record.ipfsHash]) throw new Error('ARWEAVE_FEE_NOT_SET'); - this.uploadStatus = 'signing'; const memo = JSON.stringify({ ipfs: record.ipfsHash, fileSize: record.fileBlob?.size || 0 }); try { const { transactionHash } = await sendLIKE(this.address, this.arweaveFeeTargetAddress, this.arweaveFeeMap[record.ipfsHash], this.signer, memo); @@ -780,10 +779,13 @@ export default class IscnUploadForm extends Vue { tempRecord.transactionHash = transactionHash if (!tempRecord.transactionHash) { + this.uploadStatus = 'signing'; tempRecord.transactionHash = await this.sendArweaveFeeTx(tempRecord); if (!tempRecord.transactionHash) { + this.uploadStatus = ''; throw new Error('TRANSACTION_NOT_SENT') } + this.uploadStatus = 'uploading'; } try { @@ -868,9 +870,11 @@ export default class IscnUploadForm extends Vue { this.addToEpubMetadataList(file.ipfsHash, existingData.arweaveId) return } + this.uploadStatus = 'signing'; const transactionHash = // eslint-disable-next-line no-await-in-loop existingData.transactionHash || (await this.sendArweaveFeeTx(file)) + this.uploadStatus = 'uploading'; // eslint-disable-next-line no-await-in-loop const arweaveId = await this.uploadFileAndGetArweaveId( file,