1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Clean up MetaMetricsProvider constructor (#7719)

This commit is contained in:
Whymarrh Whitby 2019-12-19 14:58:23 -03:30 committed by GitHub
parent 6c1bce28ac
commit 1820836833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,19 +42,19 @@ class MetaMetricsProvider extends Component {
constructor (props) {
super(props)
this.state = {
previousPath: '',
currentPath: window.location.href,
}
props.history.listen(() => {
this.setState({
previousPath: this.state.currentPath,
this.setState((prevState) => ({
previousPath: prevState.currentPath,
currentPath: window.location.href,
})
}))
})
}
state = {
previousPath: '',
currentPath: window.location.href,
}
getChildContext () {
const {
network,