UnauthorizedModal: use withRouter history

This commit is contained in:
Alex Gleason 2022-03-21 16:08:03 -05:00
parent 228f16f930
commit d34937e959
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -54,16 +54,13 @@ const mapDispatchToProps = dispatch => ({
@withRouter
class UnauthorizedModal extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,
};
static propTypes = {
intl: PropTypes.object.isRequired,
features: PropTypes.object.isRequired,
onClose: PropTypes.func.isRequired,
onRemoteInteraction: PropTypes.func.isRequired,
userName: PropTypes.string,
history: PropTypes.object.isRequired,
singleUserMode: PropTypes.bool,
};
@ -100,14 +97,14 @@ class UnauthorizedModal extends ImmutablePureComponent {
onLogin = (e) => {
e.preventDefault();
this.context.router.history.push('/login');
this.props.history.push('/login');
this.onClickClose();
}
onRegister = (e) => {
e.preventDefault();
this.context.router.history.push('/');
this.props.history.push('/');
this.onClickClose();
}