feat: add cancel command

This commit is contained in:
Vlad Stan 2022-07-28 15:02:17 +03:00
parent 8746045428
commit bf5e6330a8
3 changed files with 19 additions and 1 deletions

View file

@ -230,7 +230,12 @@
</q-btn>
</div>
<div class="col-3">
<q-btn v-close-popup flat color="grey" class="float-right"
<q-btn
@click="cancelOperation"
v-close-popup
flat
color="grey"
class="float-right"
>Cancel</q-btn
>
</div>

View file

@ -239,6 +239,18 @@ async function serialSigner(path) {
}
await this.writer.write(COMMAND_CONFIRM_NEXT + '\n')
},
cancelOperation: async function () {
try {
await this.writer.write(COMMAND_CANCEL + '\n')
} catch (error) {
this.$q.notify({
type: 'warning',
message: 'Failed to send cancel!',
caption: `${error}`,
timeout: 10000
})
}
},
hwwLogin: async function () {
try {
await this.writer.write(

View file

@ -8,6 +8,7 @@ const COMMAND_WIPE = '/wipe'
const COMMAND_SEED = '/seed'
const COMMAND_RESTORE = '/restore'
const COMMAND_CONFIRM_NEXT = '/confirm-next'
const COMMAND_CANCEL = '/cancel'
const DEFAULT_RECEIVE_GAP_LIMIT = 20