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

Track seed phrase validation errors with MetaMetrics

This commit is contained in:
Dan Miller 2019-04-05 00:46:25 -02:30
parent 98a2fb43fb
commit 4963ed65c0

View File

@ -36,6 +36,20 @@ export default class ImportWithSeedPhrase extends PureComponent {
.join(' ') .join(' ')
} }
componentWillMount () {
window.onbeforeunload = () => this.context.metricsEvent({
eventOpts: {
category: 'Onboarding',
action: 'Import Seed Phrase',
name: 'Close window on import screen',
},
customVariables: {
errorLabel: 'Seed Phrase Error',
errorMessage: this.state.seedPhraseError,
},
})
}
handleSeedPhraseChange (seedPhrase) { handleSeedPhraseChange (seedPhrase) {
let seedPhraseError = '' let seedPhraseError = ''
@ -172,6 +186,10 @@ export default class ImportWithSeedPhrase extends PureComponent {
action: 'Import Seed Phrase', action: 'Import Seed Phrase',
name: 'Go Back from Onboarding Import', name: 'Go Back from Onboarding Import',
}, },
customVariables: {
errorLabel: 'Seed Phrase Error',
errorMessage: seedPhraseError,
},
}) })
this.props.history.push(INITIALIZE_SELECT_ACTION_ROUTE) this.props.history.push(INITIALIZE_SELECT_ACTION_ROUTE)
}} }}