on master help sign in
- Disable sendTransaction button upon sending
1031df9Chris Johnson
src/components/StatelessTransaction.js+6−1
@@ -15,6 +15,11 @@ const StatelessTransaction = props => {
15 const { setUserApproval, userApproval } = props
15 const { setUserApproval, userApproval } = props
16 const { canSend, handleSubmit } = props
16 const { canSend, handleSubmit } = props
17
17
18+ const sendTxn = (e) => {
19+ e.target.setAttribute("disabled", true);
20+ handleSubmit()
21+ }
22+
18 const generateButtonColor =
23 const generateButtonColor =
19 Nothing.hasInstance(txn)
24 Nothing.hasInstance(txn)
20 ? 'blue'
25 ? 'blue'
@@ -150,7 +155,7 @@ const StatelessTransaction = props => {
150 prop-size={ 'xl wide' }
155 prop-size={ 'xl wide' }
151 className={ 'mt-8' }
156 className={ 'mt-8' }
152 disabled={ !canSend }
157 disabled={ !canSend }
153− onClick={ handleSubmit }
158+ onClick={ sendTxn }
154 >
159 >
155 { 'Send Transaction' }
160 { 'Send Transaction' }
156 </Button>
161 </Button>