Browse Source

fix start minting button

pull/76/head
AlphaX-Projects 2 years ago
parent
commit
69972c0b90
  1. 3
      qortal-ui-core/src/components/sidenav-menu.js
  2. 21
      qortal-ui-core/src/components/start-minting.js

3
qortal-ui-core/src/components/sidenav-menu.js

@ -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>
`; `;

21
qortal-ui-core/src/components/start-minting.js

@ -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')
} }
@ -284,14 +281,12 @@ async confirmRelationship(){
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 rewardShares = async (minterAddr) => {
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`; const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`;
const res = await fetch(url); const res = await fetch(url);
@ -301,25 +296,17 @@ async confirmRelationship(){
if (!stop) { if (!stop) {
stop = true; stop = true;
try { try {
const address = window.parent.reduxStore.getState().app?.selectedAddress?.address;
const address =
window.parent.reduxStore.getState().app?.selectedAddress?.address;
const myRewardShareArray = await rewardShares(address); const myRewardShareArray = await rewardShares(address);
if (myRewardShareArray.length > 0) { if (myRewardShareArray.length > 0) {
clearInterval(interval) clearInterval(interval)
this.status = 3 this.status = 3
this.timer = countDown(180, () => this.changeStatus(4)); this.timer = countDown(180, () => this.changeStatus(4));
} }
} catch (error) { } catch (error) {
} }
stop = false stop = false
} }
}; };
@ -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…
Cancel
Save