feat: show spinner while signing tx
This commit is contained in:
parent
99813a48cd
commit
63424d1ca4
2 changed files with 17 additions and 4 deletions
|
|
@ -56,6 +56,7 @@ new Vue({
|
||||||
showConsole: false,
|
showConsole: false,
|
||||||
showSignedPsbt: false,
|
showSignedPsbt: false,
|
||||||
sendingPsbt: false,
|
sendingPsbt: false,
|
||||||
|
signingPsbt: false,
|
||||||
psbtSent: false
|
psbtSent: false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -611,8 +612,13 @@ new Vue({
|
||||||
console.log('### navigator.serial event: connected!', event)
|
console.log('### navigator.serial event: connected!', event)
|
||||||
})
|
})
|
||||||
|
|
||||||
navigator.serial.addEventListener('disconnect', event => {
|
navigator.serial.addEventListener('disconnect', () => {
|
||||||
console.log('### navigator.serial event: disconnected!', event)
|
this.hww.authenticated = false
|
||||||
|
this.$q.notify({
|
||||||
|
type: 'warning',
|
||||||
|
message: 'Disconnected from Serial Port!',
|
||||||
|
timeout: 10000
|
||||||
|
})
|
||||||
})
|
})
|
||||||
this.serial.selectedPort = await navigator.serial.requestPort()
|
this.serial.selectedPort = await navigator.serial.requestPort()
|
||||||
// Wait for the serial port to open.
|
// Wait for the serial port to open.
|
||||||
|
|
@ -848,6 +854,7 @@ new Vue({
|
||||||
},
|
},
|
||||||
hwwSignPsbt: async function () {
|
hwwSignPsbt: async function () {
|
||||||
try {
|
try {
|
||||||
|
this.hww.signingPsbt = true
|
||||||
await this.serial.writer.write(COMMAND_SIGN_PSBT + '\n')
|
await this.serial.writer.write(COMMAND_SIGN_PSBT + '\n')
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
|
|
@ -864,6 +871,7 @@ new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSignResponse: function (res = '') {
|
handleSignResponse: function (res = '') {
|
||||||
|
this.hww.signingPsbt = false
|
||||||
this.updateSignedPsbt(res)
|
this.updateSignedPsbt(res)
|
||||||
if (this.hww.authenticated) {
|
if (this.hww.authenticated) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
|
|
|
||||||
|
|
@ -1125,7 +1125,7 @@
|
||||||
split
|
split
|
||||||
class="btn-full"
|
class="btn-full"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
:label="hww.authenticated ? 'Sign' : 'Login'"
|
:label="hww.authenticated ? 'Sign Tx' : 'Login'"
|
||||||
@click="hwwExecuteDefaultCommand()"
|
@click="hwwExecuteDefaultCommand()"
|
||||||
>
|
>
|
||||||
<q-list>
|
<q-list>
|
||||||
|
|
@ -1268,7 +1268,12 @@
|
||||||
unelevated
|
unelevated
|
||||||
color="green"
|
color="green"
|
||||||
class="btn-full"
|
class="btn-full"
|
||||||
>Confirm</q-btn
|
>Confirm
|
||||||
|
<q-spinner
|
||||||
|
v-if="hww.signingPsbt == true"
|
||||||
|
color="primary"
|
||||||
|
></q-spinner>
|
||||||
|
</q-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue