From 2f39bbdf64bcb316ebafcc89a70bd85d208967e8 Mon Sep 17 00:00:00 2001 From: Cory Chambers Date: Wed, 3 Jan 2024 07:20:59 -0500 Subject: [PATCH] Updates swiper index when user swipes or answers question. Prevents the list from being stuck on index 0 when user leaves and comes back. --- src/components/classifier/SwipeClassifier.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/classifier/SwipeClassifier.js b/src/components/classifier/SwipeClassifier.js index 4fe8e59c..a2c26b89 100644 --- a/src/components/classifier/SwipeClassifier.js +++ b/src/components/classifier/SwipeClassifier.js @@ -95,6 +95,7 @@ export class SwipeClassifier extends React.Component { const {id, first_task} = this.props.route.params.workflow this.props.classifierActions.addAnnotationToTask(id, first_task, answer, false) this.props.classifierActions.saveClassification(this.props.route.params.workflow, subject, this.state.swiperDimensions) + this.setState({swiperIndex: this.state.swiperIndex + 1}) } onSwiped = (subjectIndex) => {