From 8d8c5c5ca425b1faa2e9c389e2b9a17f516575ea Mon Sep 17 00:00:00 2001 From: Phillip Lang Martinez Date: Sat, 27 Aug 2022 17:13:04 +0300 Subject: [PATCH] fix bugs --- qortal-ui-core/src/components/start-minting.js | 6 +++--- qortal-ui-core/src/plugins/routes.js | 8 ++++---- .../core/sponsorship-list/sponsorship-list.src.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/qortal-ui-core/src/components/start-minting.js b/qortal-ui-core/src/components/start-minting.js index bc4a68c0..3d6f6121 100644 --- a/qortal-ui-core/src/components/start-minting.js +++ b/qortal-ui-core/src/components/start-minting.js @@ -342,7 +342,7 @@ class StartMinting extends connect(store)(LitElement) { stop = false } }; - interval = setInterval(getAnswer, 2000); + interval = setInterval(getAnswer, 5000); } renderStartMintingButton() { @@ -402,7 +402,7 @@ class StartMinting extends connect(store)(LitElement) { const getTxnRequestResponse = (txnResponse) => { let err6string = get('rewardsharepage.rchange21'); - if(txnResponse?.extraData?.rewardSharePrivateKey && txnResponse.success === true){ + if(txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message.includes('multiple') || txnResponse?.data?.message.includes('SELF_SHARE_EXISTS'))){ return err6string } if (txnResponse.success === false && txnResponse.message) { @@ -447,7 +447,7 @@ class StartMinting extends connect(store)(LitElement) { try { this.privateRewardShareKey = await createSponsorshipKey(); - this.confirmRelationship() + this.confirmRelationship(publicAddress) } catch (error) { console.log({error}) this.errorMsg = error?.data?.message || 'Cannot create sponsorship key'; diff --git a/qortal-ui-core/src/plugins/routes.js b/qortal-ui-core/src/plugins/routes.js index 3ce4ec66..c2101b02 100644 --- a/qortal-ui-core/src/plugins/routes.js +++ b/qortal-ui-core/src/plugins/routes.js @@ -143,14 +143,14 @@ export const routes = { if (!req.disableModal && !req.data.disableModal) { await requestTransactionDialog.requestTransaction(tx); } - + const res = await processTransaction(tx.signedBytes); let extraData = {} - if(req.data.type === 38 && tx?._rewardShareKeyPair?.secretKey){ + if(req.data.type === 38 && tx && tx._rewardShareKeyPair && tx._rewardShareKeyPair.secretKey){ extraData.rewardSharePrivateKey = Base58.encode(tx._rewardShareKeyPair.secretKey) } - - + + response = { success: true, data: res, diff --git a/qortal-ui-plugins/plugins/core/sponsorship-list/sponsorship-list.src.js b/qortal-ui-plugins/plugins/core/sponsorship-list/sponsorship-list.src.js index 38bf91be..dacc452a 100644 --- a/qortal-ui-plugins/plugins/core/sponsorship-list/sponsorship-list.src.js +++ b/qortal-ui-plugins/plugins/core/sponsorship-list/sponsorship-list.src.js @@ -156,7 +156,6 @@ class SponsorshipList extends LitElement { const address = window.parent.reduxStore.getState().app?.selectedAddress ?.address - let rewardShares = await this.getRewardShareRelationship( @@ -387,10 +386,10 @@ class SponsorshipList extends LitElement { const getTxnRequestResponse = (txnResponse) => { - if(txnResponse?.extraData?.rewardSharePrivateKey && txnResponse.success === true){ + if(txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message.includes('multiple') || txnResponse?.data?.message.includes('SELF_SHARE_EXISTS')) ){ this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey - this.confirmRelationship() + this.confirmRelationship(publicKeyValue) } else if (txnResponse.success === false && txnResponse?.message) { this.errorMessage = txnResponse?.message @@ -403,7 +402,7 @@ class SponsorshipList extends LitElement { this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey - this.confirmRelationship() + this.confirmRelationship(publicKeyValue) } else { this.errorMessage = txnResponse?.data?.message || txnResponse?.message @@ -431,6 +430,7 @@ class SponsorshipList extends LitElement { const recipientAddress = window.parent.base58PublicKeyToAddress(recipientPublicKey) + const minterAddress = window.parent.reduxStore.getState().app?.selectedAddress.address const myRewardShareArray = await parentEpml.request("apiCall", { type: "api", @@ -452,7 +452,7 @@ class SponsorshipList extends LitElement { stop = false } }; - interval = setInterval(getAnswer, 2000); + interval = setInterval(getAnswer, 5000); }