remove unused code

This commit is contained in:
ogerly 2023-01-04 10:37:50 +01:00
parent 043bf37471
commit 21d3c0c483
3 changed files with 11 additions and 23 deletions

View File

@ -106,7 +106,6 @@
</b-row> </b-row>
</template> </template>
<script> <script>
// import { BIcon } from 'bootstrap-vue'
import { SEND_TYPES } from '@/pages/Send.vue' import { SEND_TYPES } from '@/pages/Send.vue'
import InputEmail from '@/components/Inputs/InputEmail.vue' import InputEmail from '@/components/Inputs/InputEmail.vue'
import InputAmount from '@/components/Inputs/InputAmount.vue' import InputAmount from '@/components/Inputs/InputAmount.vue'
@ -115,7 +114,6 @@ import InputTextarea from '@/components/Inputs/InputTextarea.vue'
export default { export default {
name: 'TransactionForm', name: 'TransactionForm',
components: { components: {
// BIcon,
InputEmail, InputEmail,
InputAmount, InputAmount,
InputTextarea, InputTextarea,
@ -130,8 +128,6 @@ export default {
inject: ['getTunneledEmail'], inject: ['getTunneledEmail'],
data() { data() {
return { return {
amountFocused: false,
emailFocused: false,
form: { form: {
email: this.email, email: this.email,
amount: this.amount ? String(this.amount) : '', amount: this.amount ? String(this.amount) : '',
@ -143,7 +139,6 @@ export default {
}, },
methods: { methods: {
onSubmit() { onSubmit() {
this.normalizeAmount(true)
this.$emit('set-transaction', { this.$emit('set-transaction', {
selected: this.radioSelected, selected: this.radioSelected,
email: this.form.email, email: this.form.email,
@ -157,16 +152,6 @@ export default {
this.form.amount = '' this.form.amount = ''
this.form.memo = '' this.form.memo = ''
}, },
normalizeAmount(isValid) {
this.amountFocused = false
if (!isValid) return
this.form.amountValue = Number(this.form.amount.replace(',', '.'))
this.form.amount = this.$n(this.form.amountValue, 'ungroupedDecimal')
},
normalizeEmail() {
this.emailFocused = false
this.form.email = this.form.email.trim()
},
setNewRecipientEmail() { setNewRecipientEmail() {
this.form.email = this.recipientEmail ? this.recipientEmail : this.form.email this.form.email = this.recipientEmail ? this.recipientEmail : this.form.email
}, },

View File

@ -81,17 +81,10 @@ export default {
}, },
methods: { methods: {
normalizeAmount(isValid) { normalizeAmount(isValid) {
// console.log('inputAmount normalize')
this.amountFocused = false this.amountFocused = false
if (!isValid) return if (!isValid) return
this.amountValue = this.currentValue.replace(',', '.') this.amountValue = this.currentValue.replace(',', '.')
if (this.typ === 'TransactionForm') {
this.currentValue = this.$n(this.amountValue, 'ungroupedDecimal') this.currentValue = this.$n(this.amountValue, 'ungroupedDecimal')
}
if (this.typ === 'ContributionForm') {
// this.currentValue = this.amountValue
this.currentValue = this.$n(this.amountValue, 'ungroupedDecimal')
}
}, },
}, },
} }

View File

@ -16,6 +16,9 @@
:state="validated ? valid : false" :state="validated ? valid : false"
trim trim
:class="$route.path === '/send' ? 'bg-248' : ''" :class="$route.path === '/send' ? 'bg-248' : ''"
v-focus="emailFocused"
@focus="emailFocused = true"
@blur="normalizeEmail()"
></b-form-input> ></b-form-input>
<b-form-invalid-feedback v-bind="ariaMsg"> <b-form-invalid-feedback v-bind="ariaMsg">
{{ errors[0] }} {{ errors[0] }}
@ -43,6 +46,7 @@ export default {
data() { data() {
return { return {
currentValue: this.value, currentValue: this.value,
emailFocused: false,
} }
}, },
computed: { computed: {
@ -58,5 +62,11 @@ export default {
if (this.value !== this.currentValue) this.currentValue = this.value if (this.value !== this.currentValue) this.currentValue = this.value
}, },
}, },
methods: {
normalizeEmail() {
this.emailFocused = false
this.form.email = this.form.email.trim()
},
},
} }
</script> </script>