Skip to content

Commit 6ad6f92

Browse files
Fix: avoid fetching file status after navigating
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
1 parent b3414c3 commit 6ad6f92

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

assets/js/components/respondents/RespondentIndex.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ class RespondentIndex extends Component<Props, State> {
102102
}
103103
}
104104

105+
componentWillUnmount() {
106+
const timer = this.state.filesFetchTimer
107+
if (timer) {
108+
clearInterval(timer)
109+
this.setState({filesFetchTimer: null})
110+
}
111+
}
112+
105113
fetchRespondents(pageNumber = 1, overrideFilter = null) {
106114
const { projectId, surveyId, pageSize, filter, sortBy, sortAsc } = this.props
107115
const _filter = overrideFilter == null ? filter : overrideFilter

0 commit comments

Comments
 (0)