feat: add spinner while wallet account is created

This commit is contained in:
Vlad Stan 2022-08-02 12:59:10 +03:00
parent f202d80241
commit 35ab1e7d9c
3 changed files with 13 additions and 4 deletions

View file

@ -462,7 +462,10 @@ async function serialSigner(path) {
},
hwwXpub: async function (path) {
try {
console.log('### hwwXpub', COMMAND_XPUB + ' ' + this.network + ' ' + path)
console.log(
'### hwwXpub',
COMMAND_XPUB + ' ' + this.network + ' ' + path
)
await this.writer.write(
COMMAND_XPUB + ' ' + this.network + ' ' + path + '\n'
)

View file

@ -215,12 +215,14 @@
<q-btn
unelevated
color="primary"
label="Add Watch-Only Account"
:disable="
(formDialog.data.masterpub == null && accountPath == null)||
formDialog.data.title == null"
formDialog.data.title == null || showCreating"
type="submit"
>Add Watch-Only Account</q-btn
>
</q-btn>
<q-spinner v-if="showCreating" color="primary" size="2em"></q-spinner>
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
>Cancel</q-btn
>

View file

@ -28,6 +28,7 @@ async function walletList(path) {
},
accountPath: '',
filter: '',
showCreating: false,
addressTypeOptions: [
{
label: 'Pay-to-pubkey-hash scripts (P2PKH)',
@ -39,7 +40,7 @@ async function walletList(path) {
label: 'Pay-to-witness-pubkey-hash scripts (P2WPKH)',
value: 'wpkh',
pathMainnet: "m/84'/0'/0'",
pathTestnet: "m/84'/1'/0'",
pathTestnet: "m/84'/1'/0'"
},
{
label: 'Pay-to-script-hash scripts (P2SH-P2WPKH)',
@ -103,9 +104,11 @@ async function walletList(path) {
},
addWalletAccount: async function () {
this.showCreating = true
const data = _.omit(this.formDialog.data, 'wallet')
data.network = this.network
await this.createWalletAccount(data)
this.showCreating = false
},
createWalletAccount: async function (data) {
try {
@ -119,6 +122,7 @@ async function walletList(path) {
} else {
data.masterpub = `${outputType}([${fingerprint}/${path}]${xpub}/{0,1}/*)`
}
console.log('### data.masterpub', data.masterpub)
}
const response = await LNbits.api.request(
'POST',