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.
feature/default_network_editable
Dan Finlay 8 years ago
parent 535d832a64
commit 5c9969e126
  1. 0
      keychains/bip44/create-vault-complete.js
  2. 0
      keychains/bip44/recover-seed/confirmation.js
  3. 0
      keychains/bip44/restore-vault.js
  4. 66
      ui/app/actions.js
  5. 18
      ui/app/app.js
  6. 16
      ui/app/config.js
  7. 20
      ui/app/first-time/init-menu.js

@ -16,10 +16,6 @@ var actions = {
SHOW_INIT_MENU: 'SHOW_INIT_MENU', SHOW_INIT_MENU: 'SHOW_INIT_MENU',
SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED', SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED',
SHOW_INFO_PAGE: 'SHOW_INFO_PAGE', 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, unlockMetamask: unlockMetamask,
unlockFailed: unlockFailed, unlockFailed: unlockFailed,
showCreateVault: showCreateVault, showCreateVault: showCreateVault,
@ -29,10 +25,6 @@ var actions = {
createNewVaultInProgress: createNewVaultInProgress, createNewVaultInProgress: createNewVaultInProgress,
showNewVaultSeed: showNewVaultSeed, showNewVaultSeed: showNewVaultSeed,
showInfoPage: showInfoPage, showInfoPage: showInfoPage,
// seed recovery actions
REVEAL_SEED_CONFIRMATION: 'REVEAL_SEED_CONFIRMATION',
revealSeedConfirmation: revealSeedConfirmation,
requestRevealSeed: requestRevealSeed,
// unlock screen // unlock screen
UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS', UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS',
UNLOCK_FAILED: 'UNLOCK_FAILED', UNLOCK_FAILED: 'UNLOCK_FAILED',
@ -95,7 +87,6 @@ var actions = {
backToAccountDetail: backToAccountDetail, backToAccountDetail: backToAccountDetail,
showAccountsPage: showAccountsPage, showAccountsPage: showAccountsPage,
showConfTxPage: showConfTxPage, showConfTxPage: showConfTxPage,
confirmSeedWords: confirmSeedWords,
// config screen // config screen
SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE', SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE',
SET_RPC_TARGET: 'SET_RPC_TARGET', SET_RPC_TARGET: 'SET_RPC_TARGET',
@ -182,41 +173,7 @@ function createNewVault (password, entropy) {
if (err) { if (err) {
return dispatch(actions.showWarning(err.message)) return dispatch(actions.showWarning(err.message))
} }
dispatch(actions.showNewVaultSeed(result)) dispatch(actions.goHome())
})
}
}
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))
}) })
} }
} }
@ -451,27 +408,6 @@ function backToAccountDetail (address) {
value: 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 () { function showAccountsPage () {
return { return {

@ -8,8 +8,6 @@ const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
const DisclaimerScreen = require('./first-time/disclaimer') const DisclaimerScreen = require('./first-time/disclaimer')
const InitializeMenuScreen = require('./first-time/init-menu') const InitializeMenuScreen = require('./first-time/init-menu')
const CreateVaultScreen = require('./first-time/create-vault') const CreateVaultScreen = require('./first-time/create-vault')
const CreateVaultCompleteScreen = require('./first-time/create-vault-complete')
const RestoreVaultScreen = require('./first-time/restore-vault')
// unlock // unlock
const UnlockScreen = require('./unlock') const UnlockScreen = require('./unlock')
// accounts // accounts
@ -19,7 +17,6 @@ const SendTransactionScreen = require('./send')
const ConfirmTxScreen = require('./conf-tx') const ConfirmTxScreen = require('./conf-tx')
// other views // other views
const ConfigScreen = require('./config') const ConfigScreen = require('./config')
const RevealSeedConfirmation = require('./recover-seed/confirmation')
const InfoScreen = require('./info') const InfoScreen = require('./info')
const LoadingIndicator = require('./components/loading') const LoadingIndicator = require('./components/loading')
const SandwichExpando = require('sandwich-expando') const SandwichExpando = require('sandwich-expando')
@ -402,10 +399,6 @@ App.prototype.renderPrimary = function () {
return h(DisclaimerScreen, {key: 'disclaimerScreen'}) return h(DisclaimerScreen, {key: 'disclaimerScreen'})
} }
if (props.seedWords) {
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
}
// show initialize screen // show initialize screen
if (!props.isInitialized || props.forgottenPassword) { if (!props.isInitialized || props.forgottenPassword) {
// show current view // show current view
@ -414,12 +407,6 @@ App.prototype.renderPrimary = function () {
case 'createVault': case 'createVault':
return h(CreateVaultScreen, {key: 'createVault'}) return h(CreateVaultScreen, {key: 'createVault'})
case 'restoreVault':
return h(RestoreVaultScreen, {key: 'restoreVault'})
case 'createVaultComplete':
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
default: default:
return h(InitializeMenuScreen, {key: 'menuScreenInit'}) return h(InitializeMenuScreen, {key: 'menuScreenInit'})
@ -451,16 +438,15 @@ App.prototype.renderPrimary = function () {
case 'config': case 'config':
return h(ConfigScreen, {key: 'config'}) return h(ConfigScreen, {key: 'config'})
case 'reveal-seed-conf':
return h(RevealSeedConfirmation, {key: 'reveal-seed-conf'})
case 'info': case 'info':
return h(InfoScreen, {key: 'info'}) return h(InfoScreen, {key: 'info'})
case 'createVault': case 'createVault':
return h(CreateVaultScreen, {key: 'createVault'}) return h(CreateVaultScreen, {key: 'createVault'})
case 'buyEth': case 'buyEth':
return h(BuyView, {key: 'buyEthView'}) return h(BuyView, {key: 'buyEthView'})
case 'qr': case 'qr':
return h('div', { return h('div', {
style: { style: {

@ -77,22 +77,6 @@ ConfigScreen.prototype.render = function () {
currentConversionInformation(metamaskState, state), currentConversionInformation(metamaskState, state),
h('hr.horizontal-line'), 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('.flex-row.flex-center.flex-grow', [
h('hr'), h('hr'),
h('div', 'OR'), h('div', 'Advanced (Eventually?)'),
h('hr'), 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 () { InitializeMenuScreen.prototype.showCreateVault = function () {
this.props.dispatch(actions.showCreateVault()) this.props.dispatch(actions.showCreateVault())
} }
InitializeMenuScreen.prototype.showRestoreVault = function () {
this.props.dispatch(actions.showRestoreVault())
}

Loading…
Cancel
Save