feat: add password confirmation for Wipe and Restore

This commit is contained in:
Vlad Stan 2022-08-02 17:02:42 +03:00
parent c407e054fd
commit 2ae4df70ea
3 changed files with 34 additions and 7 deletions

View File

@ -286,8 +286,8 @@ async function payment(path) {
timeout: 10000
})
// await this.scanAddressWithAmount()
// todo: event
// todo: event rescan with amount
// todo: display tx id
} catch (error) {
this.sentTxId = null
this.$q.notify({

View File

@ -268,6 +268,14 @@
type="password"
label="Password"
></q-input>
<q-input
filled
dense
v-model.trim="hww.confirmedPassword"
type="password"
label="Confirm Password"
></q-input>
<q-badge color="pink" text-color="black">
This action cannot be reversed!
</q-badge>
@ -276,7 +284,7 @@
<q-btn
unelevated
color="primary"
:disable="!selectedPort"
:disable="!hww.password || hww.password.length < 8 || (hww.password !== hww.confirmedPassword)"
type="submit"
>Wipe</q-btn
>
@ -356,7 +364,7 @@
:type="hww.showMnemonic ? 'text' : 'password'"
filled
dense
hint="Word List"
label="Word List"
>
<template v-slot:append>
<q-icon
@ -374,7 +382,7 @@
:type="hww.showPassword ? 'text' : 'password'"
filled
dense
hint="New Password"
label="New Password"
>
<template v-slot:append>
<q-icon
@ -384,6 +392,14 @@
/>
</template>
</q-input>
<q-input
filled
dense
v-model.trim="hww.confirmedPassword"
type="password"
label="Confirm Password"
></q-input>
<br /><br />
<q-badge
color="pink"
@ -391,14 +407,23 @@
class="text-subtitle2"
multi-line
>
For test purposes only. Do not enter word list with real funds.
For test purposes only. Do not enter word list with real funds!!!
</q-badge>
<q-separator></q-separator>
<q-badge
color="pink"
text-color="black"
class="text-subtitle2"
multi-line
>
ALL existing data on the Hardware Device will be lost.
</q-badge>
<div class="row q-mt-lg">
<q-btn
unelevated
color="primary"
:disable="!selectedPort"
:disable="!hww.mnemonic || !hww.password || hww.password.length < 8 || (hww.password !== hww.confirmedPassword)"
type="submit"
>Restore</q-btn
>

View File

@ -440,6 +440,7 @@ async function serialSigner(path) {
})
} finally {
this.hww.password = null
this.hww.confirmedPassword = null
this.hww.showPassword = false
}
},
@ -555,6 +556,7 @@ async function serialSigner(path) {
this.hww.mnemonic = null
this.hww.showMnemonic = false
this.hww.password = null
this.hww.confirmedPassword = null
this.hww.showPassword = false
}
},