From 778400c0d7da8b5381bcd5759748a8171d4ae24f Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 5 May 2021 10:52:48 -1000 Subject: [PATCH] Cancel the debounce to avoid firing it after switching --- src/pages/home/report/ReportActionsView.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 0cab5dc1954c..dae0bb5e4f02 100644 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -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));