Skip to content

Commit

Permalink
🚸 Improve the loading text
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Mar 19, 2024
1 parent a9fc7d9 commit d8660fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d8660fc

Please sign in to comment.