[FIX] vocab items with no mistakes not hiding

This commit is contained in:
2021-10-21 20:20:49 +01:00
parent 5d2c3394e8
commit 62c9fb9847

View File

@@ -346,6 +346,7 @@ export default withRouter(class GroupStats extends Component {
<div className="mistakes-history-container"> <div className="mistakes-history-container">
{ {
this.state.filteredIncorrectAnswers this.state.filteredIncorrectAnswers
.filter((vocabItem) => vocabItem.answers && vocabItem.answers.length > 0)
.map((vocabItem, index) => { .map((vocabItem, index) => {
const sortedAnswers = vocabItem.answers const sortedAnswers = vocabItem.answers
.sort((a, b) => { .sort((a, b) => {
@@ -370,7 +371,7 @@ export default withRouter(class GroupStats extends Component {
vocabItem.switchedCount > 0 && vocabItem.switchedCount > 0 &&
<div> <div>
{ {
sortedAnswers sortedAnswers
.map((answerItem, index) => answerItem.switchLanguage && ( .map((answerItem, index) => answerItem.switchLanguage && (
<p key={index}>{answerItem.answer === "" ? <i>skipped</i> : answerItem.answer}</p> <p key={index}>{answerItem.answer === "" ? <i>skipped</i> : answerItem.answer}</p>
)) ))