mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
fix start minting button
This commit is contained in:
parent
d057c678bf
commit
69972c0b90
@ -154,7 +154,6 @@ class SidenavMenu extends connect(store)(LitElement) {
|
|||||||
>
|
>
|
||||||
<vaadin-icon icon="vaadin:list-ol" slot="icon"></vaadin-icon>
|
<vaadin-icon icon="vaadin:list-ol" slot="icon"></vaadin-icon>
|
||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
|
|
||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
<side-menu-item
|
<side-menu-item
|
||||||
label="${translate('sidemenu.wallets')}"
|
label="${translate('sidemenu.wallets')}"
|
||||||
@ -218,7 +217,7 @@ class SidenavMenu extends connect(store)(LitElement) {
|
|||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
${this.renderNodeManagement()}
|
${this.renderNodeManagement()}
|
||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
<div style="margin-top: 20px;">
|
<div>
|
||||||
<start-minting></start-minting>
|
<start-minting></start-minting>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -68,14 +68,12 @@ class StartMinting extends connect(store)(LitElement) {
|
|||||||
.start-minting-wrapper {
|
.start-minting-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(calc(-50% - 10px));
|
transform: translate(50%, 20px);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-header h1 {
|
.dialog-header h1 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -189,7 +187,6 @@ 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')
|
||||||
}
|
}
|
||||||
@ -279,52 +276,42 @@ class StartMinting extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async confirmRelationship(){
|
async confirmRelationship() {
|
||||||
const myNode =
|
const myNode =
|
||||||
store.getState().app.nodeConfig.knownNodes[
|
store.getState().app.nodeConfig.knownNodes[
|
||||||
store.getState().app.nodeConfig.node
|
store.getState().app.nodeConfig.node
|
||||||
];
|
];
|
||||||
const nodeUrl =
|
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
|
||||||
|
|
||||||
let interval = null
|
let interval = null
|
||||||
let stop = false
|
let stop = false
|
||||||
this.status = 2
|
this.status = 2
|
||||||
const getAnswer = async () => {
|
const getAnswer = async () => {
|
||||||
|
const rewardShares = async (minterAddr) => {
|
||||||
|
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`;
|
||||||
|
const res = await fetch(url);
|
||||||
|
const data = await res.json();
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
const rewardShares = async (minterAddr) => {
|
if (!stop) {
|
||||||
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`;
|
stop = true;
|
||||||
const res = await fetch(url);
|
try {
|
||||||
const data = await res.json();
|
const address = window.parent.reduxStore.getState().app?.selectedAddress?.address;
|
||||||
return data;
|
const myRewardShareArray = await rewardShares(address);
|
||||||
};
|
if (myRewardShareArray.length > 0) {
|
||||||
|
clearInterval(interval)
|
||||||
|
this.status = 3
|
||||||
|
this.timer = countDown(180, () => this.changeStatus(4));
|
||||||
|
}
|
||||||
|
|
||||||
if (!stop) {
|
} catch (error) {
|
||||||
stop = true;
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
const address =
|
|
||||||
window.parent.reduxStore.getState().app?.selectedAddress?.address;
|
|
||||||
|
|
||||||
const myRewardShareArray = await rewardShares(address);
|
|
||||||
if (myRewardShareArray.length > 0) {
|
|
||||||
clearInterval(interval)
|
|
||||||
this.status = 3
|
|
||||||
|
|
||||||
|
|
||||||
this.timer = countDown(180, () => this.changeStatus(4));
|
|
||||||
}
|
}
|
||||||
|
stop = false
|
||||||
} catch (error) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
stop = false
|
interval = setInterval(getAnswer, 5000);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
interval = setInterval(getAnswer, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderStartMintingButton() {
|
renderStartMintingButton() {
|
||||||
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
|
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
|
||||||
@ -470,7 +457,7 @@ async confirmRelationship(){
|
|||||||
3. ${translate("startminting.smchange7")}
|
3. ${translate("startminting.smchange7")}
|
||||||
</p>
|
</p>
|
||||||
<div class="row no-width">
|
<div class="row no-width">
|
||||||
<div class=${`smallLoading marginLoader marginRight ${this.status !== 3 && 'hide'}`} ></div> ${asyncReplace(this.timer)}
|
<div class=${`smallLoading marginLoader marginRight ${this.status !== 3 && 'hide'}`} ></div> <p>${asyncReplace(this.timer)}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user