Skip to content

Commit

Permalink
fix problems on props.ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Clementlgz committed May 19, 2022
1 parent 735aadc commit 9a0c65e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/portfolioPage/Corpora.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ class Corpora extends Component {
};

sort = memoize((items, criteria) => items.sort(by(`${criteria}.0`)));

componentWillReceiveProps(props) {
this.setState({
listCorpus: props.ids
})
}
listCorpus: [ ...props.ids ]
});
}
render() {
let itemsData = this.sort(this.props.items, this.state.criteria);
let items = itemsData.map(x =>
Expand Down Expand Up @@ -86,7 +85,7 @@ class Corpora extends Component {

isChecked(corpus) {
let list = this.state.listCorpus;
if (!list.includes(corpus)) {
if (list.includes(corpus)) {
return true;
}
return false;
Expand Down

0 comments on commit 9a0c65e

Please sign in to comment.