diff --git a/src/components/common/WithAPIData.js b/src/components/common/WithAPIData.js index 575d393..6df0cfd 100644 --- a/src/components/common/WithAPIData.js +++ b/src/components/common/WithAPIData.js @@ -64,6 +64,11 @@ export class WithAPIData extends Component { interval: this.props.repeatOptions.interval }; + // Clear in-flight or repeating requests so they are not orphaned + if (this.dataHandle) { + this.dataHandle.cancel(); + } + this.dataHandle = makeCancelable(this.props.apiCall(), cancelOptions); this.dataHandle.promise