Browse Source

fix(payform): fix linting issues

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
26ad641a02
  1. 5
      app/reducers/payform.js
  2. 4
      app/routes/app/containers/AppContainer.js
  3. 3
      test/components/Form.spec.js

5
app/reducers/payform.js

@ -165,9 +165,8 @@ payFormSelectors.payFormIsValid = createSelector(
payFormSelectors.isOnchain,
payFormSelectors.isLn,
payAmountSelector,
payInputSelector,
(isOnchain, isLn, amount, invoice) => {
let errors = {}
(isOnchain, isLn, amount) => {
const errors = {}
if (!isLn && amount <= 0) {
errors.amount = 'Amount must be more than 0'

4
app/routes/app/containers/AppContainer.js

@ -83,12 +83,12 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
fetchInvoice: dispatchProps.fetchInvoice,
onPayAmountBlur: () => {
// If the input is now valid and showErrors was on, turn it off
// If the amount is now valid and showErrors was on, turn it off
if (stateProps.payFormIsValid.amountIsValid && stateProps.payform.showErrors.amount) {
dispatchProps.updatePayErrors({ amount: false })
}
// If the input is not valid and showErrors was off, turn it on
// If the amount is not valid and showErrors was off, turn it on
if (!stateProps.payFormIsValid.amountIsValid && !stateProps.payform.showErrors.amount) {
dispatchProps.updatePayErrors({ amount: true })
}

3
test/components/Form.spec.js

@ -15,9 +15,12 @@ const payFormProps = {
currentAmount: '0',
inputCaption: '',
showPayLoadingScreen: false,
payFormIsValid: {},
setPayAmount: () => {},
onPayAmountBlur: () => {},
setPayInput: () => {},
onPayInputBlur: () => {},
fetchInvoice: () => {},

Loading…
Cancel
Save