Side menu journals: don't trigger recalcs on route changes.

master
Tom Hacohen 7 years ago
parent a77e9077bf
commit e085c0c40a

@ -35,6 +35,7 @@ class SideMenu extends React.PureComponent {
constructor(props: any) {
super(props);
this.logout = this.logout.bind(this);
this.journalClicked = this.journalClicked.bind(this);
}
logout() {
@ -42,6 +43,11 @@ class SideMenu extends React.PureComponent {
this.props.onCloseDrawerRequest();
}
journalClicked(journalUid: string) {
this.props.onCloseDrawerRequest();
this.props.history.push(routeResolver.getRoute('journals._id', { journalUid: journalUid }));
}
render() {
const username = (this.props.etesync && this.props.etesync.credentials.email) ?
this.props.etesync.credentials.email
@ -56,10 +62,7 @@ class SideMenu extends React.PureComponent {
<SideMenuJournals
etesync={this.props.etesync}
journals={this.props.journals.value}
onItemClick={(journalUid: string) => {
this.props.onCloseDrawerRequest();
this.props.history.push(routeResolver.getRoute('journals._id', { journalUid: journalUid }));
}}
onItemClick={this.journalClicked}
/>
</React.Fragment>
);

Loading…
Cancel
Save