TabsBar: move withRouter to outer component

error-boundary-browser-info
Alex Gleason 2021-07-10 05:13:38 -05:00
rodzic 7093e6b4de
commit c24c8aa4d1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 7 usunięć

Wyświetl plik

@ -20,7 +20,6 @@ const messages = defineMessages({
post: { id: 'tabs_bar.post', defaultMessage: 'Post' },
});
@withRouter
class TabsBar extends React.PureComponent {
static propTypes = {
@ -162,10 +161,6 @@ const mapStateToProps = state => {
notificationCount: state.getIn(['notifications', 'unread']),
chatsCount: state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0),
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 },
)(TabsBar));
)(TabsBar)));