Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
startCourseRepeating() {
const { flashcards, infoByUnits } = this.props;
const unlockedCourseFlashcards = Flashcards.getUnlockedCourseFlashcards(flashcards, infoByUnits);
const maxLastRateIndex = Flashcards.findMaxLastRateIndex(unlockedCourseFlashcards);
Toast.push('Переход к повторению по курсу');
this.setState({
onUnit: false,
onUnitRepeating: false,
sessionFlashcards: unlockedCourseFlashcards,
totalFlashcardsCount: unlockedCourseFlashcards.length,
maxLastRateIndex,
statistics: countFlashcardsStatistics(unlockedCourseFlashcards),
currentFlashcard: getNextFlashcardRandomly(unlockedCourseFlashcards, maxLastRateIndex),
});
}
componentDidCatch(error, errorInfo) {
this.setState({error});
Raven.captureException(error, {extra: errorInfo});
Toast.push('Произошла ошибка. Попробуйте перезагрузить страницу.');
}