From 75a02fa74d47585e2c909804af89327b131416c6 Mon Sep 17 00:00:00 2001 From: William Chong Date: Thu, 26 Oct 2023 14:26:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Store=20arweave=20payment=20tx?= =?UTF-8?q?=20hash=20in=20local=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/IscnRegisterForm.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index 3a0b53cd..4c2f29f8 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -783,6 +783,7 @@ export default class IscnRegisterForm extends Vue { authorName: string = '' authorUrl: string[] = [] authorWalletAddress: string[] = [] + arweavePaymentTransactionHash: string = '' uploadStatus: string = '' uploadIpfsHash: string = this.ipfsHash || '' uploadArweaveId: string = this.arweaveId || '' @@ -1364,6 +1365,7 @@ export default class IscnRegisterForm extends Vue { async sendArweaveFeeTx(): Promise { logTrackerEvent(this, 'ISCNCreate', 'SendArFeeTx', '', 1); + if (this.arweavePaymentTransactionHash) return this.arweavePaymentTransactionHash; await this.initIfNecessary() if (!this.signer) throw new Error('SIGNER_NOT_INITED'); if (!this.arweaveFeeTargetAddress) throw new Error('TARGET_ADDRESS_NOT_SET'); @@ -1371,6 +1373,7 @@ export default class IscnRegisterForm extends Vue { const memo = JSON.stringify({ ipfs: this.ipfsHash, fileSize: this.fileByteSize }); try { const { transactionHash } = await sendLIKE(this.address, this.arweaveFeeTargetAddress, this.arweaveFee.toFixed(), this.signer, memo); + if (transactionHash) this.arweavePaymentTransactionHash = transactionHash; return transactionHash; } catch (err) { this.signDialogError = (err as Error).toString() @@ -1389,7 +1392,10 @@ export default class IscnRegisterForm extends Vue { if (!this.fileBlob) return; this.isOpenSignDialog = true; this.onOpenKeplr(); - const transactionHash = await this.sendArweaveFeeTx(); + let transactionHash = this.arweavePaymentTransactionHash + if (!transactionHash) { + transactionHash = await this.sendArweaveFeeTx(); + } // Register Numbers Protocol assets along with Arweave if (this.isRegisterNumbersProtocolAsset) {