diff --git a/qortal-ui-core/src/components/start-minting.js b/qortal-ui-core/src/components/start-minting.js index 463702e2..519bc955 100644 --- a/qortal-ui-core/src/components/start-minting.js +++ b/qortal-ui-core/src/components/start-minting.js @@ -188,23 +188,24 @@ class StartMinting extends connect(store)(LitElement) { } firstUpdated() { + this.getMintingAcccounts(); this.shadowRoot.querySelector('mdc-dialog--open').setAttribute('style', 'width: 100vw') } - this.renderErrorMsg1() { + renderErrorMsg1() { return html`${translate("startminting.smchange1")}` } -this.renderErrorMsg2() { +renderErrorMsg2() { return html`${translate("startminting.smchange2")}` } -this.renderErrorMsg3() { +renderErrorMsg3() { return html`${translate("startminting.smchange3")}` } -this.renderErrorMsg4() { +renderErrorMsg4() { return html`${translate("startminting.smchange4")}` } @@ -347,7 +348,7 @@ renderStartMintingButton() { const mintingAccountData = this.mintingAccountData; - const addressInfo = this.addressInfo; + const addressInfo = window.parent.reduxStore.getState().app.accountInfo.addressInfo const address = window.parent.reduxStore.getState().app?.selectedAddress?.address; @@ -358,16 +359,16 @@ renderStartMintingButton() { const publicAddress = window.parent.reduxStore.getState().app?.selectedAddress ?.base58PublicKey; - + + const findMintingAccount = mintingAccountData.find((ma) => - ma.publicKey.includes(publicAddress) + ma.mintingAccount === address ); const isMinterButKeyMintingKeyNotAssigned = addressInfo?.error !== 124 && addressInfo?.level >= 1 && !findMintingAccount; - const makeTransactionRequest = async (lastRef) => { let mylastRef = lastRef; let rewarddialog1 = get('transactions.rewarddialog1'); @@ -396,7 +397,7 @@ renderStartMintingButton() { const getTxnRequestResponse = (txnResponse) => { let err6string = get('rewardsharepage.rchange21'); - if (txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message.includes('multiple') || txnResponse?.data?.message.includes('SELF_SHARE_EXISTS'))) { + if (txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message?.includes('multiple') || txnResponse?.data?.message?.includes('SELF_SHARE_EXISTS'))) { return err6string } if (txnResponse.success === false && txnResponse.message) { @@ -531,7 +532,8 @@ renderStartMintingButton() {
- { this.openDialogRewardShare = false @@ -542,6 +544,8 @@ renderStartMintingButton() { > ${translate("general.close")} + ` : '' } +
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 dacc452a..c4159b16 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 @@ -127,25 +127,15 @@ class SponsorshipList extends LitElement { return nodeInfo } - async saveToClipboard(text) { - try { - await navigator.clipboard.writeText(text) - parentEpml.request('showSnackBar', this.onSuccessMessage) - } catch (err) { - parentEpml.request('showSnackBar', this.onErrorMessage) - console.error('Copy to clipboard error:', err) - } - } - + changeStatus(value){ this.status = value - this.saveToClipboard(translate( - "walletpage.wchange4" - )) + } async atMount() { + this.changeLanguage() this.addressInfo = @@ -337,7 +327,7 @@ class SponsorshipList extends LitElement { } let lastRef = await getLastRef() - if (accountDetails.level >= 5) { + if (accountDetails.level >= 5 || accountDetails.flags === 1) { this.status = 1 this.errorMessage = "" @@ -386,12 +376,12 @@ class SponsorshipList extends LitElement { const getTxnRequestResponse = (txnResponse) => { - if(txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message.includes('multiple') || txnResponse?.data?.message.includes('SELF_SHARE_EXISTS')) ){ + if(txnResponse?.extraData?.rewardSharePrivateKey && (txnResponse?.data?.message?.includes('multiple') || txnResponse?.data?.message?.includes('SELF_SHARE_EXISTS')) ){ this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey this.confirmRelationship(publicKeyValue) } else if (txnResponse.success === false && txnResponse?.message) { - + this.errorMessage = txnResponse?.message this.isLoadingCreateSponsorship = false throw(txnResponse?.message) @@ -400,11 +390,11 @@ class SponsorshipList extends LitElement { !txnResponse.data.error ) { - + this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey this.confirmRelationship(publicKeyValue) } else { - + this.errorMessage = txnResponse?.data?.message || txnResponse?.message this.isLoadingCreateSponsorship = false throw(txnResponse?.data?.message || txnResponse?.message) @@ -671,7 +661,7 @@ class SponsorshipList extends LitElement { ${this.privateRewardShareKey && this.status === 4 ? html`
  • -

    Copy the key below and share it with your sponsored person.

    +

    Copy the key below and share it with your sponsored person.

    ${this.privateRewardShareKey}
    @@ -684,7 +674,7 @@ class SponsorshipList extends LitElement {

    - Warning: do not close the Qortal UI until completion! + Warning: do not leave this plugin or close the Qortal UI until completion!

    ${this.errorMessage}