Skip to content

Commit

Permalink
Allow setting of approval amount to unlimited in edit-approval-permis…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
danjm committed Nov 4, 2019
1 parent edceee2 commit f12010f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,19 @@ export default class EditApprovalPermission extends PureComponent {

render () {
const { t } = this.context
const { setCustomAmount, hideModal } = this.props

const { setCustomAmount, hideModal, customTokenAmount } = this.props
const { selectedOptionIsUnlimited, customSpendLimit } = this.state
return (
<Modal
onSubmit={() => {
setCustomAmount(Number(this.state.customSpendLimit))
setCustomAmount(!selectedOptionIsUnlimited ? customSpendLimit : '')
hideModal()
}}
submitText={t('save')}
submitType="primary"
contentClass="edit-approval-permission-modal-content"
containerClass="edit-approval-permission-modal-container"
submitDisabled={ this.state.customSpendLimit === this.props.customTokenAmount }
submitDisabled={ (customSpendLimit === customTokenAmount) && !selectedOptionIsUnlimited }
>
{ this.renderModalContent() }
</Modal>
Expand Down

0 comments on commit f12010f

Please sign in to comment.