feat: add Disconnect command

This commit is contained in:
Vlad Stan 2022-07-27 09:27:51 +03:00
parent 689cd09aef
commit 7a3b675119
2 changed files with 15 additions and 4 deletions

View file

@ -18,12 +18,12 @@
</q-item> </q-item>
<q-item <q-item
v-if="!hww.authenticated" v-if="selectedPort && !hww.authenticated"
clickable clickable
v-close-popup v-close-popup
@click="hwwShowPasswordDialog()" @click="hwwShowPasswordDialog()"
> >
<q-item-section v-if="selectedPort"> <q-item-section>
<q-item-label>Login</q-item-label> <q-item-label>Login</q-item-label>
<q-item-label caption <q-item-label caption
>Enter password for Hardware Wallet.</q-item-label >Enter password for Hardware Wallet.</q-item-label
@ -42,6 +42,17 @@
<q-item-label caption>Clear password for HWW.</q-item-label> <q-item-label caption>Clear password for HWW.</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item
v-if="selectedPort"
clickable
v-close-popup
@click="closeSerialPort()"
>
<q-item-section>
<q-item-label>Disconnect</q-item-label>
<q-item-label caption>Disconnect from Serial Port.</q-item-label>
</q-item-section>
</q-item>
<q-item <q-item
v-if="selectedPort" v-if="selectedPort"

View file

@ -37,8 +37,6 @@ async function serialSigner(path) {
toggleSerialPortConection: async function () { toggleSerialPortConection: async function () {
if (!this.selectedPort) { if (!this.selectedPort) {
this.openSerialPort() this.openSerialPort()
} else {
this.closeSerialPort()
} }
}, },
openSerialPort: async function () { openSerialPort: async function () {
@ -104,6 +102,8 @@ async function serialSigner(path) {
caption: `${error}`, caption: `${error}`,
timeout: 10000 timeout: 10000
}) })
} finally {
this.hww.authenticated = false
} }
}, },