From 4e2c744a3cd8e30a6d607c81878142e152d6b5dc Mon Sep 17 00:00:00 2001 From: Rafael Date: Tue, 13 Jul 2021 11:36:58 -0300 Subject: [PATCH 1/2] restores componentDidUpdate lifecycle --- src/pages/home/ReportScreen.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 0020eebdc831..6976c1799a0d 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -34,6 +34,15 @@ class ReportScreen extends React.Component { this.storeCurrentlyViewedReport(); } + componentDidUpdate(prevProps) { + const reportChanged = this.props.route.params.reportID !== prevProps.route.params.reportID; + + if (reportChanged) { + this.prepareTransition(); + this.storeCurrentlyViewedReport(); + } + } + componentWillUnmount() { clearTimeout(this.loadingTimerId); } From 904472a90008b3a1f556a706e4ec3f26d1b5749f Mon Sep 17 00:00:00 2001 From: Rafael Djuric <53711423+rdjuric@users.noreply.github.com> Date: Tue, 13 Jul 2021 13:45:57 -0300 Subject: [PATCH 2/2] removes empty line Co-authored-by: Rocio Perez --- src/pages/home/ReportScreen.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 6976c1799a0d..ae87bc4b6921 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -36,7 +36,6 @@ class ReportScreen extends React.Component { componentDidUpdate(prevProps) { const reportChanged = this.props.route.params.reportID !== prevProps.route.params.reportID; - if (reportChanged) { this.prepareTransition(); this.storeCurrentlyViewedReport();