mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-04-23 11:27:52 +00:00
fix bugs
This commit is contained in:
parent
4d6ea5a6e8
commit
c55228a49c
@ -188,23 +188,24 @@ class StartMinting extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
|
|
||||||
this.getMintingAcccounts();
|
this.getMintingAcccounts();
|
||||||
this.shadowRoot.querySelector('mdc-dialog--open').setAttribute('style', 'width: 100vw')
|
this.shadowRoot.querySelector('mdc-dialog--open').setAttribute('style', 'width: 100vw')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderErrorMsg1() {
|
renderErrorMsg1() {
|
||||||
return html`${translate("startminting.smchange1")}`
|
return html`${translate("startminting.smchange1")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderErrorMsg2() {
|
renderErrorMsg2() {
|
||||||
return html`${translate("startminting.smchange2")}`
|
return html`${translate("startminting.smchange2")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderErrorMsg3() {
|
renderErrorMsg3() {
|
||||||
return html`${translate("startminting.smchange3")}`
|
return html`${translate("startminting.smchange3")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderErrorMsg4() {
|
renderErrorMsg4() {
|
||||||
return html`${translate("startminting.smchange4")}`
|
return html`${translate("startminting.smchange4")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +348,7 @@ renderStartMintingButton() {
|
|||||||
|
|
||||||
const mintingAccountData = this.mintingAccountData;
|
const mintingAccountData = this.mintingAccountData;
|
||||||
|
|
||||||
const addressInfo = this.addressInfo;
|
const addressInfo = window.parent.reduxStore.getState().app.accountInfo.addressInfo
|
||||||
|
|
||||||
const address =
|
const address =
|
||||||
window.parent.reduxStore.getState().app?.selectedAddress?.address;
|
window.parent.reduxStore.getState().app?.selectedAddress?.address;
|
||||||
@ -358,16 +359,16 @@ renderStartMintingButton() {
|
|||||||
const publicAddress =
|
const publicAddress =
|
||||||
window.parent.reduxStore.getState().app?.selectedAddress
|
window.parent.reduxStore.getState().app?.selectedAddress
|
||||||
?.base58PublicKey;
|
?.base58PublicKey;
|
||||||
|
|
||||||
|
|
||||||
const findMintingAccount = mintingAccountData.find((ma) =>
|
const findMintingAccount = mintingAccountData.find((ma) =>
|
||||||
ma.publicKey.includes(publicAddress)
|
ma.mintingAccount === address
|
||||||
);
|
);
|
||||||
|
|
||||||
const isMinterButKeyMintingKeyNotAssigned =
|
const isMinterButKeyMintingKeyNotAssigned =
|
||||||
addressInfo?.error !== 124 &&
|
addressInfo?.error !== 124 &&
|
||||||
addressInfo?.level >= 1 &&
|
addressInfo?.level >= 1 &&
|
||||||
!findMintingAccount;
|
!findMintingAccount;
|
||||||
|
|
||||||
const makeTransactionRequest = async (lastRef) => {
|
const makeTransactionRequest = async (lastRef) => {
|
||||||
let mylastRef = lastRef;
|
let mylastRef = lastRef;
|
||||||
let rewarddialog1 = get('transactions.rewarddialog1');
|
let rewarddialog1 = get('transactions.rewarddialog1');
|
||||||
@ -396,7 +397,7 @@ renderStartMintingButton() {
|
|||||||
|
|
||||||
const getTxnRequestResponse = (txnResponse) => {
|
const getTxnRequestResponse = (txnResponse) => {
|
||||||
let err6string = get('rewardsharepage.rchange21');
|
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
|
return err6string
|
||||||
}
|
}
|
||||||
if (txnResponse.success === false && txnResponse.message) {
|
if (txnResponse.success === false && txnResponse.message) {
|
||||||
@ -531,7 +532,8 @@ renderStartMintingButton() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modalFooter">
|
<div class="modalFooter">
|
||||||
<mwc-button
|
${this.errorMsg || this.status === 5 ? html`
|
||||||
|
<mwc-button
|
||||||
slot="primaryAction"
|
slot="primaryAction"
|
||||||
@click=${() => {
|
@click=${() => {
|
||||||
this.openDialogRewardShare = false
|
this.openDialogRewardShare = false
|
||||||
@ -542,6 +544,8 @@ renderStartMintingButton() {
|
|||||||
>
|
>
|
||||||
${translate("general.close")}
|
${translate("general.close")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
|
` : '' }
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -127,25 +127,15 @@ class SponsorshipList extends LitElement {
|
|||||||
return nodeInfo
|
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){
|
changeStatus(value){
|
||||||
this.status = value
|
this.status = value
|
||||||
this.saveToClipboard(translate(
|
|
||||||
"walletpage.wchange4"
|
|
||||||
))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async atMount() {
|
async atMount() {
|
||||||
|
|
||||||
this.changeLanguage()
|
this.changeLanguage()
|
||||||
|
|
||||||
this.addressInfo =
|
this.addressInfo =
|
||||||
@ -337,7 +327,7 @@ class SponsorshipList extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let lastRef = await getLastRef()
|
let lastRef = await getLastRef()
|
||||||
if (accountDetails.level >= 5) {
|
if (accountDetails.level >= 5 || accountDetails.flags === 1) {
|
||||||
this.status = 1
|
this.status = 1
|
||||||
|
|
||||||
this.errorMessage = ""
|
this.errorMessage = ""
|
||||||
@ -386,12 +376,12 @@ class SponsorshipList extends LitElement {
|
|||||||
|
|
||||||
const getTxnRequestResponse = (txnResponse) => {
|
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.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey
|
||||||
this.confirmRelationship(publicKeyValue)
|
this.confirmRelationship(publicKeyValue)
|
||||||
} else if (txnResponse.success === false && txnResponse?.message) {
|
} else if (txnResponse.success === false && txnResponse?.message) {
|
||||||
|
|
||||||
this.errorMessage = txnResponse?.message
|
this.errorMessage = txnResponse?.message
|
||||||
this.isLoadingCreateSponsorship = false
|
this.isLoadingCreateSponsorship = false
|
||||||
throw(txnResponse?.message)
|
throw(txnResponse?.message)
|
||||||
@ -400,11 +390,11 @@ class SponsorshipList extends LitElement {
|
|||||||
!txnResponse.data.error
|
!txnResponse.data.error
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey
|
this.privateRewardShareKey = txnResponse?.extraData?.rewardSharePrivateKey
|
||||||
this.confirmRelationship(publicKeyValue)
|
this.confirmRelationship(publicKeyValue)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.errorMessage = txnResponse?.data?.message || txnResponse?.message
|
this.errorMessage = txnResponse?.data?.message || txnResponse?.message
|
||||||
this.isLoadingCreateSponsorship = false
|
this.isLoadingCreateSponsorship = false
|
||||||
throw(txnResponse?.data?.message || txnResponse?.message)
|
throw(txnResponse?.data?.message || txnResponse?.message)
|
||||||
@ -671,7 +661,7 @@ class SponsorshipList extends LitElement {
|
|||||||
${this.privateRewardShareKey && this.status === 4 ? html`
|
${this.privateRewardShareKey && this.status === 4 ? html`
|
||||||
<li class=${`column word-break ${this.status < 4 && 'inactiveText' }`}>
|
<li class=${`column word-break ${this.status < 4 && 'inactiveText' }`}>
|
||||||
|
|
||||||
<p>Copy the key below and share it with your sponsored person.</p>
|
<p style="work-break: break-word">Copy the key below and share it with your sponsored person.</p>
|
||||||
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
|
<div style="background: #eee; padding: 8px; margin: 8px 0; border-radius: 5px;">
|
||||||
<span style="color: #000;">${this.privateRewardShareKey}</span>
|
<span style="color: #000;">${this.privateRewardShareKey}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -684,7 +674,7 @@ class SponsorshipList extends LitElement {
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="warning column">
|
<div class="warning column">
|
||||||
<p>
|
<p>
|
||||||
Warning: do not close the Qortal UI until completion!
|
Warning: do not leave this plugin or close the Qortal UI until completion!
|
||||||
</p>
|
</p>
|
||||||
<p class="message-error">${this.errorMessage}</p>
|
<p class="message-error">${this.errorMessage}</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user