added refetch data when a user adds sponsor key
This commit is contained in:
parent
a784594b23
commit
16d19b0e51
@ -96,7 +96,7 @@ class BecomeMinter extends LitElement {
|
|||||||
return mintingAccountData;
|
return mintingAccountData;
|
||||||
}
|
}
|
||||||
|
|
||||||
async firstUpdated() {
|
async atMount() {
|
||||||
this.changeLanguage();
|
this.changeLanguage();
|
||||||
|
|
||||||
this.addressInfo =
|
this.addressInfo =
|
||||||
@ -125,6 +125,10 @@ class BecomeMinter extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async firstUpdated() {
|
||||||
|
await this.atMount();
|
||||||
|
}
|
||||||
|
|
||||||
async getRewardShareRelationship(recipientAddress) {
|
async getRewardShareRelationship(recipientAddress) {
|
||||||
const myRewardShareArray = await parentEpml.request('apiCall', {
|
const myRewardShareArray = await parentEpml.request('apiCall', {
|
||||||
type: 'api',
|
type: 'api',
|
||||||
@ -174,7 +178,11 @@ class BecomeMinter extends LitElement {
|
|||||||
|
|
||||||
${isAlreadySponsored
|
${isAlreadySponsored
|
||||||
? ''
|
? ''
|
||||||
: html` <not-sponsored></not-sponsored> `}
|
: html`
|
||||||
|
<not-sponsored
|
||||||
|
.atMount="${() => this.atMount()}"
|
||||||
|
></not-sponsored>
|
||||||
|
`}
|
||||||
${!isAlreadySponsored
|
${!isAlreadySponsored
|
||||||
? ''
|
? ''
|
||||||
: html`
|
: html`
|
||||||
|
@ -15,13 +15,12 @@ import { pageStyles } from '../become-minter-css.src.js';
|
|||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||||
// hello
|
// hello
|
||||||
class NotSponsored extends LitElement {
|
class NotSponsored extends LitElement {
|
||||||
static get properties() {
|
static properties = {
|
||||||
return {
|
atMount: { type: Function },
|
||||||
isLoadingSponsorshipKeySubmit: { type: Boolean },
|
isLoadingSponsorshipKeySubmit: { type: Boolean },
|
||||||
sponsorshipKeyValue: { type: String },
|
sponsorshipKeyValue: { type: String },
|
||||||
addMintingAccountMessage: { type: String },
|
addMintingAccountMessage: { type: String },
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
static styles = [pageStyles];
|
static styles = [pageStyles];
|
||||||
|
|
||||||
@ -30,6 +29,7 @@ class NotSponsored extends LitElement {
|
|||||||
this.isLoadingSponsorshipKeySubmit = false;
|
this.isLoadingSponsorshipKeySubmit = false;
|
||||||
this.sponsorshipKeyValue = '';
|
this.sponsorshipKeyValue = '';
|
||||||
this.addMintingAccountMessage = '';
|
this.addMintingAccountMessage = '';
|
||||||
|
this.atMount = () => {};
|
||||||
}
|
}
|
||||||
|
|
||||||
renderErr1Text() {
|
renderErr1Text() {
|
||||||
@ -61,7 +61,8 @@ class NotSponsored extends LitElement {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res === true) {
|
if (res === true) {
|
||||||
this.updateMintingAccounts();
|
// refetch data
|
||||||
|
this.atMount();
|
||||||
this.sponsorshipKeyValue = '';
|
this.sponsorshipKeyValue = '';
|
||||||
this.addMintingAccountMessage = this.renderErr1Text();
|
this.addMintingAccountMessage = this.renderErr1Text();
|
||||||
this.isLoadingSponsorshipKeySubmit = false;
|
this.isLoadingSponsorshipKeySubmit = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user