mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove opinionated seed word code
Completely breaking all account maangement, I have removed the opinionated seed-word code from the UI. Web3 injection still seems to work.
This commit is contained in:
parent
535d832a64
commit
5c9969e126
@ -16,10 +16,6 @@ var actions = {
|
||||
SHOW_INIT_MENU: 'SHOW_INIT_MENU',
|
||||
SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED',
|
||||
SHOW_INFO_PAGE: 'SHOW_INFO_PAGE',
|
||||
RECOVER_FROM_SEED: 'RECOVER_FROM_SEED',
|
||||
CLEAR_SEED_WORD_CACHE: 'CLEAR_SEED_WORD_CACHE',
|
||||
clearSeedWordCache: clearSeedWordCache,
|
||||
recoverFromSeed: recoverFromSeed,
|
||||
unlockMetamask: unlockMetamask,
|
||||
unlockFailed: unlockFailed,
|
||||
showCreateVault: showCreateVault,
|
||||
@ -29,10 +25,6 @@ var actions = {
|
||||
createNewVaultInProgress: createNewVaultInProgress,
|
||||
showNewVaultSeed: showNewVaultSeed,
|
||||
showInfoPage: showInfoPage,
|
||||
// seed recovery actions
|
||||
REVEAL_SEED_CONFIRMATION: 'REVEAL_SEED_CONFIRMATION',
|
||||
revealSeedConfirmation: revealSeedConfirmation,
|
||||
requestRevealSeed: requestRevealSeed,
|
||||
// unlock screen
|
||||
UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS',
|
||||
UNLOCK_FAILED: 'UNLOCK_FAILED',
|
||||
@ -95,7 +87,6 @@ var actions = {
|
||||
backToAccountDetail: backToAccountDetail,
|
||||
showAccountsPage: showAccountsPage,
|
||||
showConfTxPage: showConfTxPage,
|
||||
confirmSeedWords: confirmSeedWords,
|
||||
// config screen
|
||||
SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE',
|
||||
SET_RPC_TARGET: 'SET_RPC_TARGET',
|
||||
@ -182,41 +173,7 @@ function createNewVault (password, entropy) {
|
||||
if (err) {
|
||||
return dispatch(actions.showWarning(err.message))
|
||||
}
|
||||
dispatch(actions.showNewVaultSeed(result))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function revealSeedConfirmation () {
|
||||
return {
|
||||
type: this.REVEAL_SEED_CONFIRMATION,
|
||||
}
|
||||
}
|
||||
|
||||
function requestRevealSeed (password) {
|
||||
return (dispatch) => {
|
||||
dispatch(actions.showLoadingIndication())
|
||||
_accountManager.tryPassword(password, (err, seed) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
_accountManager.recoverSeed((err, seed) => {
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
dispatch(actions.showNewVaultSeed(seed))
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function recoverFromSeed (password, seed) {
|
||||
return (dispatch) => {
|
||||
// dispatch(actions.createNewVaultInProgress())
|
||||
dispatch(actions.showLoadingIndication())
|
||||
_accountManager.recoverFromSeed(password, seed, (err, metamaskState) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
|
||||
var account = Object.keys(metamaskState.identities)[0]
|
||||
dispatch(actions.unlockMetamask(account))
|
||||
dispatch(actions.goHome())
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -451,27 +408,6 @@ function backToAccountDetail (address) {
|
||||
value: address,
|
||||
}
|
||||
}
|
||||
function clearSeedWordCache (account) {
|
||||
return {
|
||||
type: actions.CLEAR_SEED_WORD_CACHE,
|
||||
value: account,
|
||||
}
|
||||
}
|
||||
|
||||
function confirmSeedWords () {
|
||||
return (dispatch) => {
|
||||
dispatch(actions.showLoadingIndication())
|
||||
_accountManager.clearSeedWordCache((err, account) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
if (err) {
|
||||
return dispatch(actions.showWarning(err.message))
|
||||
}
|
||||
|
||||
console.log('Seed word cache cleared. ' + account)
|
||||
dispatch(actions.showAccountDetail(account))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function showAccountsPage () {
|
||||
return {
|
||||
|
@ -8,8 +8,6 @@ const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||||
const DisclaimerScreen = require('./first-time/disclaimer')
|
||||
const InitializeMenuScreen = require('./first-time/init-menu')
|
||||
const CreateVaultScreen = require('./first-time/create-vault')
|
||||
const CreateVaultCompleteScreen = require('./first-time/create-vault-complete')
|
||||
const RestoreVaultScreen = require('./first-time/restore-vault')
|
||||
// unlock
|
||||
const UnlockScreen = require('./unlock')
|
||||
// accounts
|
||||
@ -19,7 +17,6 @@ const SendTransactionScreen = require('./send')
|
||||
const ConfirmTxScreen = require('./conf-tx')
|
||||
// other views
|
||||
const ConfigScreen = require('./config')
|
||||
const RevealSeedConfirmation = require('./recover-seed/confirmation')
|
||||
const InfoScreen = require('./info')
|
||||
const LoadingIndicator = require('./components/loading')
|
||||
const SandwichExpando = require('sandwich-expando')
|
||||
@ -402,10 +399,6 @@ App.prototype.renderPrimary = function () {
|
||||
return h(DisclaimerScreen, {key: 'disclaimerScreen'})
|
||||
}
|
||||
|
||||
if (props.seedWords) {
|
||||
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
|
||||
}
|
||||
|
||||
// show initialize screen
|
||||
if (!props.isInitialized || props.forgottenPassword) {
|
||||
// show current view
|
||||
@ -414,12 +407,6 @@ App.prototype.renderPrimary = function () {
|
||||
case 'createVault':
|
||||
return h(CreateVaultScreen, {key: 'createVault'})
|
||||
|
||||
case 'restoreVault':
|
||||
return h(RestoreVaultScreen, {key: 'restoreVault'})
|
||||
|
||||
case 'createVaultComplete':
|
||||
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
|
||||
|
||||
default:
|
||||
return h(InitializeMenuScreen, {key: 'menuScreenInit'})
|
||||
|
||||
@ -451,16 +438,15 @@ App.prototype.renderPrimary = function () {
|
||||
case 'config':
|
||||
return h(ConfigScreen, {key: 'config'})
|
||||
|
||||
case 'reveal-seed-conf':
|
||||
return h(RevealSeedConfirmation, {key: 'reveal-seed-conf'})
|
||||
|
||||
case 'info':
|
||||
return h(InfoScreen, {key: 'info'})
|
||||
|
||||
case 'createVault':
|
||||
return h(CreateVaultScreen, {key: 'createVault'})
|
||||
|
||||
case 'buyEth':
|
||||
return h(BuyView, {key: 'buyEthView'})
|
||||
|
||||
case 'qr':
|
||||
return h('div', {
|
||||
style: {
|
||||
|
@ -77,22 +77,6 @@ ConfigScreen.prototype.render = function () {
|
||||
currentConversionInformation(metamaskState, state),
|
||||
h('hr.horizontal-line'),
|
||||
|
||||
h('div', {
|
||||
style: {
|
||||
marginTop: '20px',
|
||||
},
|
||||
}, [
|
||||
h('button', {
|
||||
style: {
|
||||
alignSelf: 'center',
|
||||
},
|
||||
onClick (event) {
|
||||
event.preventDefault()
|
||||
state.dispatch(actions.revealSeedConfirmation())
|
||||
},
|
||||
}, 'Reveal Seed Words'),
|
||||
]),
|
||||
|
||||
]),
|
||||
]),
|
||||
])
|
||||
|
@ -63,33 +63,15 @@ InitializeMenuScreen.prototype.renderMenu = function () {
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
h('hr'),
|
||||
h('div', 'OR'),
|
||||
h('div', 'Advanced (Eventually?)'),
|
||||
h('hr'),
|
||||
]),
|
||||
|
||||
h('button.primary', {
|
||||
onClick: this.showRestoreVault.bind(this),
|
||||
style: {
|
||||
margin: 12,
|
||||
},
|
||||
}, 'Restore Existing Vault'),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
// InitializeMenuScreen.prototype.splitWor = function() {
|
||||
// this.props.dispatch(actions.showInitializeMenu())
|
||||
// }
|
||||
|
||||
InitializeMenuScreen.prototype.showInitializeMenu = function () {
|
||||
this.props.dispatch(actions.showInitializeMenu())
|
||||
}
|
||||
|
||||
InitializeMenuScreen.prototype.showCreateVault = function () {
|
||||
this.props.dispatch(actions.showCreateVault())
|
||||
}
|
||||
|
||||
InitializeMenuScreen.prototype.showRestoreVault = function () {
|
||||
this.props.dispatch(actions.showRestoreVault())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user