You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
621 B
26 lines
621 B
import React, { PureComponent } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import Loading from '../../loading-screen'
|
|
import { DEFAULT_ROUTE } from '../../../routes'
|
|
|
|
export default class Lock extends PureComponent {
|
|
static propTypes = {
|
|
history: PropTypes.object,
|
|
isUnlocked: PropTypes.bool,
|
|
lockMetamask: PropTypes.func,
|
|
}
|
|
|
|
componentDidMount () {
|
|
const { lockMetamask, isUnlocked, history } = this.props
|
|
|
|
if (isUnlocked) {
|
|
lockMetamask().then(() => history.push(DEFAULT_ROUTE))
|
|
} else {
|
|
history.replace(DEFAULT_ROUTE)
|
|
}
|
|
}
|
|
|
|
render () {
|
|
return <Loading />
|
|
}
|
|
}
|
|
|