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>
</template>
<script>
// import { BIcon } from 'bootstrap-vue'
import { SEND_TYPES } from '@/pages/Send.vue'
import InputEmail from '@/components/Inputs/InputEmail.vue'
import InputAmount from '@/components/Inputs/InputAmount.vue'
@ -115,7 +114,6 @@ import InputTextarea from '@/components/Inputs/InputTextarea.vue'
export default {
name: 'TransactionForm',
components: {
// BIcon,
InputEmail,
InputAmount,
InputTextarea,
@ -130,8 +128,6 @@ export default {
inject: ['getTunneledEmail'],
data() {
return {
amountFocused: false,
emailFocused: false,
form: {
email: this.email,
amount: this.amount ? String(this.amount) : '',
@ -143,7 +139,6 @@ export default {
},
methods: {
onSubmit() {
this.normalizeAmount(true)
this.$emit('set-transaction', {
selected: this.radioSelected,
email: this.form.email,
@ -157,16 +152,6 @@ export default {
this.form.amount = ''
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() {
this.form.email = this.recipientEmail ? this.recipientEmail : this.form.email
},

View File

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

View File

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