mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-14 19:25:50 +00:00
Fix save key
This commit is contained in:
parent
7aa298b6be
commit
e9b2a76a87
@ -256,7 +256,7 @@ class ExportKeys extends connect(store)(LitElement) {
|
|||||||
addTradeBotRoutes(parentEpml)
|
addTradeBotRoutes(parentEpml)
|
||||||
parentEpml.imReady()
|
parentEpml.imReady()
|
||||||
await this.fetchArrrWalletAddress()
|
await this.fetchArrrWalletAddress()
|
||||||
this.fetchArrrWalletPrivateKey()
|
this.checkArrrWalletPrivateKey()
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchArrrWalletAddress() {
|
async fetchArrrWalletAddress() {
|
||||||
@ -277,7 +277,7 @@ class ExportKeys extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchArrrWalletPrivateKey() {
|
async checkArrrWalletPrivateKey() {
|
||||||
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||||
const privateKeyUrl = `${nodeUrl}/crosschain/arrr/walletprivatekey?apiKey=${this.getApiKey()}`
|
const privateKeyUrl = `${nodeUrl}/crosschain/arrr/walletprivatekey?apiKey=${this.getApiKey()}`
|
||||||
@ -290,23 +290,37 @@ class ExportKeys extends connect(store)(LitElement) {
|
|||||||
this.arrrPMK = ''
|
this.arrrPMK = ''
|
||||||
this.enableArrr = false
|
this.enableArrr = false
|
||||||
this.shadowRoot.querySelector('#needCoreUpdate').show()
|
this.shadowRoot.querySelector('#needCoreUpdate').show()
|
||||||
} else if (res != null && res.error != 1201) {
|
|
||||||
this.arrrPMK = ''
|
|
||||||
this.enableArrr = true
|
|
||||||
this.arrrPMK = res
|
|
||||||
} else {
|
} else {
|
||||||
this.arrrPMK = ''
|
this.fetchArrrWalletPrivateKey()
|
||||||
this.enableArrr = false
|
|
||||||
this.shadowRoot.querySelector('#arrrWalletNotSynced').show()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fetchArrrWalletPrivateKey() {
|
||||||
|
let resPK = await parentEpml.request('apiCall', {
|
||||||
|
url: `/crosschain/arrr/walletprivatekey?apiKey=${this.getApiKey()}`,
|
||||||
|
method: 'POST',
|
||||||
|
body: `${store.getState().app.selectedAddress.arrrWallet.seed58}`
|
||||||
|
})
|
||||||
|
|
||||||
|
if (resPK != null && resPK.error != 1201) {
|
||||||
|
this.arrrPMK = ''
|
||||||
|
this.enableArrr = true
|
||||||
|
this.arrrPMK = resPK
|
||||||
|
} else {
|
||||||
|
this.arrrPMK = ''
|
||||||
|
this.enableArrr = false
|
||||||
|
this.shadowRoot.querySelector('#arrrWalletNotSynced').show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
closeArrrWalletNotSynced() {
|
closeArrrWalletNotSynced() {
|
||||||
this.shadowRoot.querySelector('#arrrWalletNotSynced').close()
|
this.shadowRoot.querySelector('#arrrWalletNotSynced').close()
|
||||||
}
|
}
|
||||||
|
|
||||||
closeNeedCoreUpdate() {
|
closeNeedCoreUpdate() {
|
||||||
|
this.arrrPMK = ''
|
||||||
|
this.enableArrr = false
|
||||||
this.shadowRoot.querySelector('#needCoreUpdate').close()
|
this.shadowRoot.querySelector('#needCoreUpdate').close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user