Skip to content

Commit

Permalink
solves tag duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Mar 20, 2020
1 parent a3406d0 commit 0dfe1b0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/block-library/src/latest-posts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,9 @@ class LatestPostsEdit extends Component {
} );
request.then( unescapeTerms ).then( ( terms ) => {
this.setState( ( state ) => ( {
suggestedTags: state.tagsList.concat(
terms.filter(
( term ) =>
! find(
state.tagsList,
( tag ) => tag.id === term.id
)
)
suggestedTags: terms.filter(
( term ) =>
! find( state.tagsList, ( tag ) => tag.id === term.id )
),
} ) );
} );
Expand Down

0 comments on commit 0dfe1b0

Please sign in to comment.