Browse Source

added refetch data when a user adds sponsor key

pull/50/head
Phillip Lang Martinez 2 years ago
parent
commit
16d19b0e51
  1. 12
      qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js
  2. 17
      qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js

12
qortal-ui-plugins/plugins/core/become-minter/become-minter.src.js

@ -96,7 +96,7 @@ class BecomeMinter extends LitElement {
return mintingAccountData;
}
async firstUpdated() {
async atMount() {
this.changeLanguage();
this.addressInfo =
@ -125,6 +125,10 @@ class BecomeMinter extends LitElement {
}
}
async firstUpdated() {
await this.atMount();
}
async getRewardShareRelationship(recipientAddress) {
const myRewardShareArray = await parentEpml.request('apiCall', {
type: 'api',
@ -174,7 +178,11 @@ class BecomeMinter extends LitElement {
${isAlreadySponsored
? ''
: html` <not-sponsored></not-sponsored> `}
: html`
<not-sponsored
.atMount="${() => this.atMount()}"
></not-sponsored>
`}
${!isAlreadySponsored
? ''
: html`

17
qortal-ui-plugins/plugins/core/become-minter/components/not-sponsored.src.js

@ -15,13 +15,12 @@ import { pageStyles } from '../become-minter-css.src.js';
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
// hello
class NotSponsored extends LitElement {
static get properties() {
return {
isLoadingSponsorshipKeySubmit: { type: Boolean },
sponsorshipKeyValue: { type: String },
addMintingAccountMessage: { type: String },
};
}
static properties = {
atMount: { type: Function },
isLoadingSponsorshipKeySubmit: { type: Boolean },
sponsorshipKeyValue: { type: String },
addMintingAccountMessage: { type: String },
};
static styles = [pageStyles];
@ -30,6 +29,7 @@ class NotSponsored extends LitElement {
this.isLoadingSponsorshipKeySubmit = false;
this.sponsorshipKeyValue = '';
this.addMintingAccountMessage = '';
this.atMount = () => {};
}
renderErr1Text() {
@ -61,7 +61,8 @@ class NotSponsored extends LitElement {
})
.then((res) => {
if (res === true) {
this.updateMintingAccounts();
// refetch data
this.atMount();
this.sponsorshipKeyValue = '';
this.addMintingAccountMessage = this.renderErr1Text();
this.isLoadingSponsorshipKeySubmit = false;

Loading…
Cancel
Save