Skip to content

Commit

Permalink
Track seed phrase validation errors with MetaMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Apr 5, 2019
1 parent 98a2fb4 commit 4963ed6
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ export default class ImportWithSeedPhrase extends PureComponent {
.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) {
let seedPhraseError = ''

Expand Down Expand Up @@ -172,6 +186,10 @@ export default class ImportWithSeedPhrase extends PureComponent {
action: 'Import Seed Phrase',
name: 'Go Back from Onboarding Import',
},
customVariables: {
errorLabel: 'Seed Phrase Error',
errorMessage: seedPhraseError,
},
})
this.props.history.push(INITIALIZE_SELECT_ACTION_ROUTE)
}}
Expand Down

0 comments on commit 4963ed6

Please sign in to comment.