feat: buttonConfig pins are optional
This commit is contained in:
-2
@@ -83,7 +83,6 @@
|
|||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
v-model.trim="config.buttonOnePin"
|
v-model.trim="config.buttonOnePin"
|
||||||
type="number"
|
|
||||||
label="Pin Number (Button 1)"
|
label="Pin Number (Button 1)"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,7 +93,6 @@
|
|||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
v-model.trim="config.buttonTwoPin"
|
v-model.trim="config.buttonTwoPin"
|
||||||
type="number"
|
|
||||||
label="Pin Number (Button 2)"
|
label="Pin Number (Button 2)"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-6
@@ -5,12 +5,8 @@ async function serialPortConfig(path) {
|
|||||||
props: ['config'],
|
props: ['config'],
|
||||||
template: t,
|
template: t,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {}
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,7 +243,7 @@
|
|||||||
<div class="row q-mt-lg">
|
<div class="row q-mt-lg">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-badge class="text-subtitle2" color="yellow" text-color="black">
|
<q-badge class="text-subtitle2" color="yellow" text-color="black">
|
||||||
<span>Check data on the display of the hardware device.</span>
|
<span>Confirm on the hardware device also.</span>
|
||||||
</q-badge>
|
</q-badge>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ async function serialSigner(path) {
|
|||||||
this.hww.showPasswordDialog = true
|
this.hww.showPasswordDialog = true
|
||||||
await this.sendCommandSecure(COMMAND_PASSWORD)
|
await this.sendCommandSecure(COMMAND_PASSWORD)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Failed to connect to Hardware Wallet!',
|
message: 'Failed to connect to Hardware Wallet!',
|
||||||
@@ -599,11 +600,14 @@ async function serialSigner(path) {
|
|||||||
)
|
)
|
||||||
const publicKeyHex = publicKey.toHex().slice(2)
|
const publicKeyHex = publicKey.toHex().slice(2)
|
||||||
|
|
||||||
await this.sendCommandClearText(COMMAND_PAIR, [
|
const args = [publicKeyHex]
|
||||||
publicKeyHex,
|
if (Number.isInteger(+this.config.buttonOnePin)) {
|
||||||
this.config.buttonOnePin,
|
args.push(this.config.buttonOnePin)
|
||||||
this.config.buttonTwoPin
|
}
|
||||||
])
|
if (Number.isInteger(+this.config.buttonTwoPin)) {
|
||||||
|
args.push(this.config.buttonTwoPin)
|
||||||
|
}
|
||||||
|
await this.sendCommandClearText(COMMAND_PAIR, args)
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
message: 'Pairing started!',
|
message: 'Pairing started!',
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ const PAIRING_CONTROL_TEXT = 'lnbits'
|
|||||||
|
|
||||||
const HWW_DEFAULT_CONFIG = Object.freeze({
|
const HWW_DEFAULT_CONFIG = Object.freeze({
|
||||||
name: '',
|
name: '',
|
||||||
buttonOnePin: 0,
|
buttonOnePin: '',
|
||||||
buttonTwoPin: 35,
|
buttonTwoPin: '',
|
||||||
baudRate: 9600,
|
baudRate: 9600,
|
||||||
bufferSize: 255,
|
bufferSize: 255,
|
||||||
dataBits: 8,
|
dataBits: 8,
|
||||||
|
|||||||
Reference in New Issue
Block a user