Skip to content

Commit

Permalink
FlatTermSelector: Set Correct Loading State (#13758)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrommen authored and youknowriad committed Mar 6, 2019
1 parent 36280b8 commit 37fc7b5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ class FlatTermSelector extends Component {
this.searchTerms = throttle( this.searchTerms.bind( this ), 500 );
this.findOrCreateTerm = this.findOrCreateTerm.bind( this );
this.state = {
loading: false,
loading: ! isEmpty( this.props.terms ),
availableTerms: [],
selectedTerms: [],
};
}

componentDidMount() {
if ( ! isEmpty( this.props.terms ) ) {
this.setState( { loading: false } );
this.initRequest = this.fetchTerms( {
include: this.props.terms.join( ',' ),
per_page: -1,
Expand Down

0 comments on commit 37fc7b5

Please sign in to comment.