Skip to content

Commit

Permalink
Chrome: Fix adding new categories and terms
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 30, 2017
1 parent 71eb775 commit 32647cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/sidebar/post-taxonomies/hierarchical-term-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class HierarchicalTermSelector extends Component {
} );
findOrCreatePromise
.then( ( term ) => {
const hasTerm = !! find( this.state.availableTerms, ( availableTerm ) => availableTerm.id !== term.id );
const newAvailableTerms = hasTerm ? this.state.availableTerms : [ ...this.state.availableTerms, term ];
const hasTerm = !! find( this.state.availableTerms, ( availableTerm ) => availableTerm.id === term.id );
const newAvailableTerms = hasTerm ? this.state.availableTerms : [ term, ...this.state.availableTerms ];
const { onUpdateTerms, restBase, terms } = this.props;
this.setState( {
adding: false,
Expand Down

0 comments on commit 32647cd

Please sign in to comment.