Skip to content

Commit

Permalink
Fix: avoid fetching file status after navigating
Browse files Browse the repository at this point in the history
Without invalidating the timer, navigating from one survey to another
would keep the status for both surveys' files to be fetched, yielding
bugs in the UI.

See #2350
See #2362
  • Loading branch information
matiasgarciaisaia committed Dec 9, 2024
1 parent b3414c3 commit 6ad6f92
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/js/components/respondents/RespondentIndex.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ class RespondentIndex extends Component<Props, State> {
}
}

componentWillUnmount() {
const timer = this.state.filesFetchTimer
if (timer) {
clearInterval(timer)
this.setState({filesFetchTimer: null})
}
}

fetchRespondents(pageNumber = 1, overrideFilter = null) {
const { projectId, surveyId, pageSize, filter, sortBy, sortAsc } = this.props
const _filter = overrideFilter == null ? filter : overrideFilter
Expand Down

0 comments on commit 6ad6f92

Please sign in to comment.