mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-07 03:18:10 +02:00
fix: close serial port when re-pairing fails
This commit is contained in:
parent
f1670c3153
commit
a8b90bd595
@ -610,10 +610,10 @@ async function serialSigner(path) {
|
||||
}
|
||||
},
|
||||
handleCheckPairingResponse: async function (res = '') {
|
||||
const [statusCode, encryptedMessage] = res.split(' ')
|
||||
const [statusCode, message] = res.split(' ')
|
||||
switch (statusCode) {
|
||||
case '0':
|
||||
const controlText = await this.decryptData(encryptedMessage)
|
||||
const controlText = await this.decryptData(message)
|
||||
if (controlText == PAIRING_CONTROL_TEXT) {
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
@ -629,6 +629,16 @@ async function serialSigner(path) {
|
||||
})
|
||||
}
|
||||
break
|
||||
case '1':
|
||||
this.closeSerialPort()
|
||||
this.$q.notify({
|
||||
type: 'warning',
|
||||
message:
|
||||
'Re-pairing failed. Remove (forget) device and try again!',
|
||||
caption: `Error: ${message}`,
|
||||
timeout: 10000
|
||||
})
|
||||
break
|
||||
default:
|
||||
// noting to do here yet
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user