feat: prompt for Connect and Login before signing
This commit is contained in:
@@ -10,6 +10,7 @@ async function payment(path) {
|
||||
'utxos',
|
||||
'mempool_endpoint',
|
||||
'sats_denominated',
|
||||
'serial-signer-ref',
|
||||
'adminkey'
|
||||
],
|
||||
watch: {
|
||||
@@ -76,9 +77,21 @@ async function payment(path) {
|
||||
return satOrBtc(val, showUnit, this['sats_denominated'])
|
||||
},
|
||||
checkAndSend: async function () {
|
||||
this.showChecking = true
|
||||
try {
|
||||
console.log('### this.checkAndSend')
|
||||
this.showChecking = true
|
||||
console.log(
|
||||
'### this.checkAndSend',
|
||||
this.serialSignerRef.isConnected()
|
||||
)
|
||||
if (!this.serialSignerRef.isConnected()) {
|
||||
await this.serialSignerRef.openSerialPort()
|
||||
return
|
||||
}
|
||||
if (!this.serialSignerRef.isAuthenticated()) {
|
||||
await this.serialSignerRef.hwwShowPasswordDialog()
|
||||
return
|
||||
}
|
||||
|
||||
await this.createPsbt()
|
||||
} catch (error) {
|
||||
} finally {
|
||||
|
||||
@@ -107,6 +107,13 @@ async function serialSigner(path) {
|
||||
}
|
||||
},
|
||||
|
||||
isConnected: function () {
|
||||
return !!this.selectedPort
|
||||
},
|
||||
isAuthenticated: function () {
|
||||
return this.hww.authenticated
|
||||
},
|
||||
|
||||
checkSerialPortSupported: function () {
|
||||
if (!navigator.serial) {
|
||||
this.$q.notify({
|
||||
|
||||
@@ -273,9 +273,6 @@ const watchOnly = async () => {
|
||||
},
|
||||
//################### SERIAL PORT ###################
|
||||
|
||||
sharePsbtWithAnimatedQRCode: async function () {
|
||||
console.log('### sharePsbtWithAnimatedQRCode')
|
||||
},
|
||||
//################### HARDWARE WALLET ###################
|
||||
|
||||
//################### UTXOs ###################
|
||||
|
||||
Reference in New Issue
Block a user