From bbcbb3138589029bc1a19dfd8d04dcc10d8559ad Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Fri, 29 Sep 2017 13:28:40 -0500 Subject: [PATCH] feature(on-chain focus): focus amount input if zap detects on-chain --- app/components/Form/PayForm.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/components/Form/PayForm.js b/app/components/Form/PayForm.js index 7a46f994..dd65163a 100644 --- a/app/components/Form/PayForm.js +++ b/app/components/Form/PayForm.js @@ -7,6 +7,15 @@ import CurrencyIcon from 'components/CurrencyIcon' import styles from './PayForm.scss' class PayForm extends Component { + componentDidUpdate(prevProps) { + const { isOnchain, isLn, payform: { payInput } } = this.props + + if (isOnchain) { this.amountInput.focus() } + if ((prevProps.payInput !== payInput) && isLn) { + console.log('go get the invoice') + } + } + render() { const { payform,