Skip to content

Commit

Permalink
Cancel the debounce to avoid firing it after switching
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed May 5, 2021
1 parent 2f66572 commit 778400c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ class ReportActionsView extends React.Component {
this.keyboardEvent.remove();
}

// We must cancel the debounce function so that we do not call the function when switching to a new chat before
// the previous one has finished loading completely.
this.recordTimeToMeasureItemLayout.cancel();

AppState.removeEventListener('change', this.onVisibilityChange);

_.each(this.timers, timer => clearTimeout(timer));
Expand Down

0 comments on commit 778400c

Please sign in to comment.