diff --git a/package.json b/package.json index 17ad8dc..dcc1bc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lyzeli", - "version": "1.3.0", + "version": "1.3.1", "private": true, "dependencies": { "@popperjs/core": "^2.9.2", diff --git a/src/components/SentimentItem/index.js b/src/components/SentimentItem/index.js index e7a81cb..4e61a17 100644 --- a/src/components/SentimentItem/index.js +++ b/src/components/SentimentItem/index.js @@ -22,7 +22,7 @@ export default class SentimentItem extends Component { } handleDelete(tag) { - return this.props.onRemoveComment(tag); + this.props.onRemoveComment(tag); } change = (color) => { @@ -43,7 +43,9 @@ export default class SentimentItem extends Component { if (comments && comments[this.props.type.key]) { const result = {}; - const authors = Object.keys(comments[this.props.type.key]); + const authors = Object.keys(comments[this.props.type.key]).filter( + (a) => a !== "Consensus" + ); if (authors.length > 1) { authors.forEach((author) => { const opinions = comments[this.props.type.key][author]; @@ -70,8 +72,11 @@ export default class SentimentItem extends Component { const { answer, sentiment, sentimentManual } = this.props.item; const comments = { ...this.props.item.comments }; const consensus = this.consensus(); + if (consensus && consensus.length) { comments[this.props.type.key]["Consensus"] = consensus; + } else if (comments[this.props.type.key]) { + delete comments[this.props.type.key]["Consensus"]; } let authors = []; @@ -118,44 +123,49 @@ export default class SentimentItem extends Component {