mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove unused seed phrase action (#8537)
This commit is contained in:
parent
8a12257f8e
commit
a2fc06dce9
@ -5,7 +5,6 @@ import Button from '../../../../components/ui/button'
|
|||||||
import {
|
import {
|
||||||
INITIALIZE_END_OF_FLOW_ROUTE,
|
INITIALIZE_END_OF_FLOW_ROUTE,
|
||||||
INITIALIZE_SEED_PHRASE_ROUTE,
|
INITIALIZE_SEED_PHRASE_ROUTE,
|
||||||
DEFAULT_ROUTE,
|
|
||||||
} from '../../../../helpers/constants/routes'
|
} from '../../../../helpers/constants/routes'
|
||||||
import { exportAsFile } from '../../../../helpers/utils/util'
|
import { exportAsFile } from '../../../../helpers/utils/util'
|
||||||
import DraggableSeed from './draggable-seed.component'
|
import DraggableSeed from './draggable-seed.component'
|
||||||
@ -23,12 +22,10 @@ export default class ConfirmSeedPhrase extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
hideSeedPhraseBackupAfterOnboarding: PropTypes.func,
|
|
||||||
history: PropTypes.object,
|
history: PropTypes.object,
|
||||||
seedPhrase: PropTypes.string,
|
seedPhrase: PropTypes.string,
|
||||||
initializeThreeBox: PropTypes.func,
|
initializeThreeBox: PropTypes.func,
|
||||||
setSeedPhraseBackedUp: PropTypes.func,
|
setSeedPhraseBackedUp: PropTypes.func,
|
||||||
showingSeedPhraseBackupAfterOnboarding: PropTypes.bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -73,8 +70,6 @@ export default class ConfirmSeedPhrase extends PureComponent {
|
|||||||
const {
|
const {
|
||||||
history,
|
history,
|
||||||
setSeedPhraseBackedUp,
|
setSeedPhraseBackedUp,
|
||||||
showingSeedPhraseBackupAfterOnboarding,
|
|
||||||
hideSeedPhraseBackupAfterOnboarding,
|
|
||||||
initializeThreeBox,
|
initializeThreeBox,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
@ -92,13 +87,8 @@ export default class ConfirmSeedPhrase extends PureComponent {
|
|||||||
})
|
})
|
||||||
|
|
||||||
setSeedPhraseBackedUp(true).then(() => {
|
setSeedPhraseBackedUp(true).then(() => {
|
||||||
if (showingSeedPhraseBackupAfterOnboarding) {
|
initializeThreeBox()
|
||||||
hideSeedPhraseBackupAfterOnboarding()
|
history.push(INITIALIZE_END_OF_FLOW_ROUTE)
|
||||||
history.push(DEFAULT_ROUTE)
|
|
||||||
} else {
|
|
||||||
initializeThreeBox()
|
|
||||||
history.push(INITIALIZE_END_OF_FLOW_ROUTE)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message)
|
console.error(error.message)
|
||||||
|
@ -2,24 +2,14 @@ import { connect } from 'react-redux'
|
|||||||
import ConfirmSeedPhrase from './confirm-seed-phrase.component'
|
import ConfirmSeedPhrase from './confirm-seed-phrase.component'
|
||||||
import {
|
import {
|
||||||
setSeedPhraseBackedUp,
|
setSeedPhraseBackedUp,
|
||||||
hideSeedPhraseBackupAfterOnboarding,
|
|
||||||
initializeThreeBox,
|
initializeThreeBox,
|
||||||
} from '../../../../store/actions'
|
} from '../../../../store/actions'
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
|
||||||
const { appState: { showingSeedPhraseBackupAfterOnboarding } } = state
|
|
||||||
|
|
||||||
return {
|
|
||||||
showingSeedPhraseBackupAfterOnboarding,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
const mapDispatchToProps = (dispatch) => {
|
||||||
return {
|
return {
|
||||||
setSeedPhraseBackedUp: (seedPhraseBackupState) => dispatch(setSeedPhraseBackedUp(seedPhraseBackupState)),
|
setSeedPhraseBackedUp: (seedPhraseBackupState) => dispatch(setSeedPhraseBackedUp(seedPhraseBackupState)),
|
||||||
hideSeedPhraseBackupAfterOnboarding: () => dispatch(hideSeedPhraseBackupAfterOnboarding()),
|
|
||||||
initializeThreeBox: () => dispatch(initializeThreeBox()),
|
initializeThreeBox: () => dispatch(initializeThreeBox()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(ConfirmSeedPhrase)
|
export default connect(null, mapDispatchToProps)(ConfirmSeedPhrase)
|
||||||
|
@ -2242,12 +2242,6 @@ export function setSeedPhraseBackedUp (seedPhraseBackupState) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hideSeedPhraseBackupAfterOnboarding () {
|
|
||||||
return {
|
|
||||||
type: actionConstants.HIDE_SEED_PHRASE_BACKUP_AFTER_ONBOARDING,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function initializeThreeBox () {
|
export function initializeThreeBox () {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user