kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'actually-actually-actually-actually-fix-tabs-bar' into 'develop'
TabsBar: move withRouter to outer component Closes #680 See merge request soapbox-pub/soapbox-fe!601merge-requests/602/head
commit
f208d350a2
|
@ -20,7 +20,6 @@ const messages = defineMessages({
|
||||||
post: { id: 'tabs_bar.post', defaultMessage: 'Post' },
|
post: { id: 'tabs_bar.post', defaultMessage: 'Post' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@withRouter
|
|
||||||
class TabsBar extends React.PureComponent {
|
class TabsBar extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -162,10 +161,6 @@ const mapStateToProps = state => {
|
||||||
notificationCount: state.getIn(['notifications', 'unread']),
|
notificationCount: state.getIn(['notifications', 'unread']),
|
||||||
chatsCount: state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0),
|
chatsCount: state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0),
|
||||||
dashboardCount: reportsCount + approvalCount,
|
dashboardCount: reportsCount + approvalCount,
|
||||||
|
|
||||||
// HACK: We made things too efficient and now the tabs bar doesn't work right
|
|
||||||
// ¯\_(ツ)_/¯
|
|
||||||
forceRerender: Math.random(),
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -178,6 +173,6 @@ const mapDispatchToProps = (dispatch) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(
|
export default withRouter(injectIntl(
|
||||||
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
|
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
|
||||||
)(TabsBar));
|
)(TabsBar)));
|
||||||
|
|
Ładowanie…
Reference in New Issue