Skip to content

Commit

Permalink
Merge pull request #3908 from rdjuric/transitionFix
Browse files Browse the repository at this point in the history
Improves transition when changing chats

(cherry picked from commit b1f09a3)
  • Loading branch information
roryabraham authored and roryabraham committed Jul 9, 2021
1 parent 38a852c commit 28814e5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ 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);
}
Expand Down Expand Up @@ -73,7 +64,7 @@ class ReportScreen extends React.Component {
this.setState({isLoading: true});

clearTimeout(this.loadingTimerId);
this.loadingTimerId = setTimeout(() => this.setState({isLoading: false}), 300);
this.loadingTimerId = setTimeout(() => this.setState({isLoading: false}), 150);
}

/**
Expand All @@ -94,7 +85,7 @@ class ReportScreen extends React.Component {

<FullScreenLoadingIndicator visible={this.shouldShowLoader()} />

<ReportView reportID={this.getReportID()} />
{!this.shouldShowLoader() && <ReportView reportID={this.getReportID()} />}
</ScreenWrapper>
);
}
Expand Down

0 comments on commit 28814e5

Please sign in to comment.