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