mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-17 19:12:29 +02:00
fix: close serial port when re-pairing fails
This commit is contained in:
@@ -610,10 +610,10 @@ async function serialSigner(path) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCheckPairingResponse: async function (res = '') {
|
handleCheckPairingResponse: async function (res = '') {
|
||||||
const [statusCode, encryptedMessage] = res.split(' ')
|
const [statusCode, message] = res.split(' ')
|
||||||
switch (statusCode) {
|
switch (statusCode) {
|
||||||
case '0':
|
case '0':
|
||||||
const controlText = await this.decryptData(encryptedMessage)
|
const controlText = await this.decryptData(message)
|
||||||
if (controlText == PAIRING_CONTROL_TEXT) {
|
if (controlText == PAIRING_CONTROL_TEXT) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
@@ -629,6 +629,16 @@ async function serialSigner(path) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
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:
|
default:
|
||||||
// noting to do here yet
|
// noting to do here yet
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user