Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Removed unused isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac committed Nov 1, 2016
1 parent a15a5f3 commit 12101f4
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions js/src/ui/Form/InputAddress/inputAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,8 @@ class InputAddress extends Component {
onSubmit: PropTypes.func
};

state = {
isEmpty: false
}

componentWillMount () {
const { value, text, accountsInfo, tokens } = this.props;

const account = accountsInfo[value] || tokens[value];
const hasAccount = account && (!account.meta || !account.meta.deleted);
const inputValue = text && hasAccount ? account.name : value;
const isEmpty = (!inputValue || inputValue.length === 0);

this.setState({ isEmpty });
}

componentWillReceiveProps (newProps) {
const { value, text } = newProps;

if (value === this.props.value && text === this.props.text) {
return;
}

const inputValue = text || value;
const isEmpty = (!inputValue || inputValue.length === 0);

this.setState({ isEmpty });
}

render () {
const { className, disabled, error, label, hint, value, text, onSubmit, accountsInfo, tokens } = this.props;
const { isEmpty } = this.state;

const account = accountsInfo[value] || tokens[value];
const hasAccount = account && (!account.meta || !account.meta.deleted);
Expand Down

0 comments on commit 12101f4

Please sign in to comment.