feat: allow Connect from dropdown menu
This commit is contained in:
parent
9374433153
commit
3054248858
4 changed files with 13 additions and 8 deletions
|
|
@ -84,7 +84,6 @@ async function payment(path) {
|
|||
try {
|
||||
if (!this.serialSignerRef.isConnected()) {
|
||||
await this.serialSignerRef.openSerialPort()
|
||||
return
|
||||
}
|
||||
if (!this.serialSignerRef.isAuthenticated()) {
|
||||
await this.serialSignerRef.hwwShowPasswordDialog()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
color="primary"
|
||||
icon="usb"
|
||||
:text-color="selectedPort ? hww.authenticated ? 'green' : 'orange' : 'white'"
|
||||
@click="toggleSerialPortConection"
|
||||
@click="openSerialPort"
|
||||
>
|
||||
<q-list>
|
||||
<q-item v-if="!selectedPort" clickable v-close-popup>
|
||||
|
|
@ -42,6 +42,17 @@
|
|||
<q-item-label caption>Clear password for HWW.</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="!selectedPort"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openSerialPort()"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Connect</q-item-label>
|
||||
<q-item-label caption>Connect Serial Port device.</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="selectedPort"
|
||||
clickable
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ async function serialSigner(path) {
|
|||
},
|
||||
|
||||
methods: {
|
||||
toggleSerialPortConection: async function () {
|
||||
if (!this.selectedPort) {
|
||||
this.openSerialPort()
|
||||
}
|
||||
},
|
||||
openSerialPort: async function () {
|
||||
if (!this.checkSerialPortSupported()) return
|
||||
if (this.selectedPort) return
|
||||
console.log('### openSerialPort', this.selectedPort)
|
||||
try {
|
||||
navigator.serial.addEventListener('connect', event => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ async function walletConfig(path) {
|
|||
return satOrBtc(val, showUnit, this.config.data.sats_denominated)
|
||||
},
|
||||
updateConfig: async function () {
|
||||
// const wallet = this.g.user.wallets[0]
|
||||
try {
|
||||
await LNbits.api.request(
|
||||
'PUT',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue