mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 22:24:27 +01:00
fba17d77de
* Refactor and fix styling for first time flow. Remove seed phrase from persisted metamask state * Fix linting and tests * Fix translations, initialization notice routing * Fix drizzle tests * Fix e2e tests * Fix integration tests * Fix styling * Fix migration naming from 030 to 031 * Open extension in browser when user has not completed onboarding
27 lines
621 B
JavaScript
27 lines
621 B
JavaScript
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 />
|
|
}
|
|
}
|