From 5a7f79b547b647eebb00f61eddfa6d11e7ee6ae3 Mon Sep 17 00:00:00 2001 From: William Chong Date: Fri, 16 Feb 2024 19:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Rename=20object=20name=20from=20?= =?UTF-8?q?records=20to=20record?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/IscnUploadForm.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/components/IscnUploadForm.vue b/components/IscnUploadForm.vue index 950c7923..e3a470aa 100644 --- a/components/IscnUploadForm.vue +++ b/components/IscnUploadForm.vue @@ -654,10 +654,10 @@ export default class IscnUploadForm extends Vue { } } - async sendArweaveFeeTx(records: any): Promise { + async sendArweaveFeeTx(record: any): Promise { logTrackerEvent(this, 'ISCNCreate', 'SendArFeeTx', '', 1); - if (this.sentArweaveTransactionInfo.has(records.ipfsHash)) { - const transactionInfo = this.sentArweaveTransactionInfo.get(records.ipfsHash); + if (this.sentArweaveTransactionInfo.has(record.ipfsHash)) { + const transactionInfo = this.sentArweaveTransactionInfo.get(record.ipfsHash); if (transactionInfo && transactionInfo.transactionHash) { return transactionInfo.transactionHash; } @@ -667,12 +667,12 @@ 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'); this.uploadStatus = 'signing'; - const memo = JSON.stringify({ ipfs: records.ipfsHash, fileSize: records.fileBlob?.size || 0 }); + const memo = JSON.stringify({ ipfs: record.ipfsHash, fileSize: record.fileBlob?.size || 0 }); try { const { transactionHash } = await sendLIKE(this.address, this.arweaveFeeTargetAddress, this.arweaveFee.toFixed(), this.signer, memo); if (transactionHash) { - const existingData = this.sentArweaveTransactionInfo.get(records.ipfsHash) || {}; - this.sentArweaveTransactionInfo.set(records.ipfsHash, { ...existingData, transactionHash }); + const existingData = this.sentArweaveTransactionInfo.get(record.ipfsHash) || {}; + this.sentArweaveTransactionInfo.set(record.ipfsHash, { ...existingData, transactionHash }); return transactionHash; } @@ -687,11 +687,11 @@ export default class IscnUploadForm extends Vue { return ''; } - async submitToArweave(records: any): Promise { - const existingData = this.sentArweaveTransactionInfo.get(records.ipfsHash) || {}; + async submitToArweave(record: any): Promise { + const existingData = this.sentArweaveTransactionInfo.get(record.ipfsHash) || {}; const { transactionHash, arweaveId: uploadArweaveId } = existingData; if (uploadArweaveId) return - const tempRecord = {...records} + const tempRecord = {...record} logTrackerEvent(this, 'ISCNCreate', 'SubmitToArweave', '', 1); if (!tempRecord.fileBlob) return; this.isOpenSignDialog = true; @@ -715,10 +715,10 @@ export default class IscnUploadForm extends Vue { txHash: tempRecord.transactionHash, }); if (arweaveId) { - const uploadedData = this.sentArweaveTransactionInfo.get(records.ipfsHash) || {}; - this.sentArweaveTransactionInfo.set(records.ipfsHash, { ...uploadedData, arweaveId }); + const uploadedData = this.sentArweaveTransactionInfo.get(record.ipfsHash) || {}; + this.sentArweaveTransactionInfo.set(record.ipfsHash, { ...uploadedData, arweaveId }); if (tempRecord.fileName.includes('cover.jpeg')) { - const metadata = this.epubMetadataList.find((file: any) => file.thum === records.ipfsHash) + const metadata = this.epubMetadataList.find((file: any) => file.thum === record.ipfsHash) if (metadata) { metadata.thumbnailArweaveId = arweaveId }