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
  • Loading branch information
roryabraham authored Jul 8, 2021
2 parents fea7789 + d3bb1a3 commit b1f09a3
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 b1f09a3

Please sign in to comment.