Add clear button for verify

This commit is contained in:
Kyle Zsembery 2020-11-23 15:47:12 +11:00
parent 898f9165c2
commit 17d17082a7
1 changed files with 19 additions and 1 deletions

View File

@ -61,6 +61,12 @@
:disable="!signatureToVerify || !unsignedData || !address" :disable="!signatureToVerify || !unsignedData || !address"
@click="verify()" @click="verify()"
/> />
<q-btn
v-if="canClear"
:label="$t('buttons.clear')"
color="secondary"
@click="clear"
/>
</div> </div>
<SignatureDialog <SignatureDialog
:on-copy="copySignature" :on-copy="copySignature"
@ -98,7 +104,14 @@ export default {
computed: mapState({ computed: mapState({
theme: state => state.gateway.app.config.appearance.theme, theme: state => state.gateway.app.config.appearance.theme,
sign_status: state => state.gateway.sign_status, sign_status: state => state.gateway.sign_status,
verify_status: state => state.gateway.verify_status verify_status: state => state.gateway.verify_status,
canClear() {
const canClear =
this.signatureToVerify !== "" ||
this.address !== "" ||
this.unsignedData !== "";
return canClear;
}
}), }),
watch: { watch: {
sign_status: { sign_status: {
@ -167,6 +180,11 @@ export default {
}, },
closeDialog() { closeDialog() {
this.signature = ""; this.signature = "";
},
clear() {
this.signatureToVerify = "";
this.unsignedData = "";
this.address = "";
} }
} }
}; };