Skip to content

Commit

Permalink
🎨 Rename object name from records to record
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Feb 16, 2024
1 parent d2b9769 commit 5a7f79b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,10 @@ export default class IscnUploadForm extends Vue {
}
}
async sendArweaveFeeTx(records: any): Promise<string> {
async sendArweaveFeeTx(record: any): Promise<string> {
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;
}
Expand All @@ -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;
}
Expand All @@ -687,11 +687,11 @@ export default class IscnUploadForm extends Vue {
return '';
}
async submitToArweave(records: any): Promise<void> {
const existingData = this.sentArweaveTransactionInfo.get(records.ipfsHash) || {};
async submitToArweave(record: any): Promise<void> {
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;
Expand All @@ -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
}
Expand Down

0 comments on commit 5a7f79b

Please sign in to comment.