mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Fix more transition bugs
This commit is contained in:
parent
b628df017f
commit
29facfe4d6
@ -312,19 +312,20 @@ function backToAccountDetail(address) {
|
|||||||
value: address,
|
value: address,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function clearSeedWordCache() {
|
function clearSeedWordCache(account) {
|
||||||
return {
|
return {
|
||||||
type: this.CLEAR_SEED_WORD_CACHE
|
type: this.CLEAR_SEED_WORD_CACHE,
|
||||||
|
value: account,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmSeedWords() {
|
function confirmSeedWords() {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(this.showLoadingIndication())
|
dispatch(this.showLoadingIndication())
|
||||||
_accountManager.clearSeedWordCache((err, accounts) => {
|
_accountManager.clearSeedWordCache((err, account) => {
|
||||||
dispatch(this.clearSeedWordCache())
|
dispatch(this.clearSeedWordCache(account))
|
||||||
console.log('Seed word cache cleared.')
|
console.log('Seed word cache cleared. ' + account)
|
||||||
dispatch(this.showAccountDetail(accounts[0].address))
|
dispatch(this.showAccountDetail(account))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,12 +157,9 @@ App.prototype.toggleMetamaskActive = function(){
|
|||||||
App.prototype.renderPrimary = function(state){
|
App.prototype.renderPrimary = function(state){
|
||||||
var state = this.props
|
var state = this.props
|
||||||
|
|
||||||
// If seed words haven't been dismissed yet, show them still.
|
|
||||||
/*
|
|
||||||
if (state.seedWords) {
|
if (state.seedWords) {
|
||||||
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
|
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// show initialize screen
|
// show initialize screen
|
||||||
if (!state.isInitialized) {
|
if (!state.isInitialized) {
|
||||||
@ -176,6 +173,9 @@ App.prototype.renderPrimary = function(state){
|
|||||||
case 'restoreVault':
|
case 'restoreVault':
|
||||||
return h(RestoreVaultScreen, {key: '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'})
|
||||||
|
|
||||||
@ -190,9 +190,6 @@ App.prototype.renderPrimary = function(state){
|
|||||||
// show current view
|
// show current view
|
||||||
switch (state.currentView.name) {
|
switch (state.currentView.name) {
|
||||||
|
|
||||||
case 'createVaultComplete':
|
|
||||||
return h(CreateVaultCompleteScreen, {key: 'created-vault'})
|
|
||||||
|
|
||||||
case 'accounts':
|
case 'accounts':
|
||||||
return h(AccountsScreen, {key: 'accounts'})
|
return h(AccountsScreen, {key: 'accounts'})
|
||||||
|
|
||||||
|
@ -29,15 +29,6 @@ InitializeMenuScreen.prototype.render = function() {
|
|||||||
|
|
||||||
switch (state.currentView.name) {
|
switch (state.currentView.name) {
|
||||||
|
|
||||||
case 'createVault':
|
|
||||||
return h(CreateVaultScreen)
|
|
||||||
|
|
||||||
case 'createVaultComplete':
|
|
||||||
return h(CreateVaultCompleteScreen)
|
|
||||||
|
|
||||||
case 'restoreVault':
|
|
||||||
return this.renderRestoreVault()
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return this.renderMenu()
|
return this.renderMenu()
|
||||||
|
|
||||||
@ -80,31 +71,6 @@ InitializeMenuScreen.prototype.renderMenu = function() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeMenuScreen.prototype.renderRestoreVault = function() {
|
|
||||||
var state = this.props
|
|
||||||
return (
|
|
||||||
|
|
||||||
h('.initialize-screen.flex-column.flex-center.flex-grow', [
|
|
||||||
|
|
||||||
// subtitle and nav
|
|
||||||
h('.section-title.flex-row.flex-center', [
|
|
||||||
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
|
||||||
onClick: this.showInitializeMenu.bind(this),
|
|
||||||
}),
|
|
||||||
h('h2.page-subtitle', 'Restore Vault'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
|
|
||||||
h('h3', 'Coming soon....'),
|
|
||||||
// h('textarea.twelve-word-phrase', {
|
|
||||||
// value: 'hey ho what the actual hello rubber duck bumbersnatch crumplezone frankenfurter',
|
|
||||||
// }),
|
|
||||||
|
|
||||||
])
|
|
||||||
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// InitializeMenuScreen.prototype.splitWor = function() {
|
// InitializeMenuScreen.prototype.splitWor = function() {
|
||||||
// this.props.dispatch(actions.showInitializeMenu())
|
// this.props.dispatch(actions.showInitializeMenu())
|
||||||
// }
|
// }
|
||||||
|
@ -278,10 +278,13 @@ function reduceApp(state, action) {
|
|||||||
case actions.CLEAR_SEED_WORD_CACHE:
|
case actions.CLEAR_SEED_WORD_CACHE:
|
||||||
return extend(appState, {
|
return extend(appState, {
|
||||||
transForward: true,
|
transForward: true,
|
||||||
currentView: {
|
currentView: {},
|
||||||
name: 'accounts',
|
|
||||||
},
|
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
accountDetail: {
|
||||||
|
subview: 'transactions',
|
||||||
|
accountExport: 'none',
|
||||||
|
privateKey: '',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.DISPLAY_WARNING:
|
case actions.DISPLAY_WARNING:
|
||||||
|
@ -69,17 +69,24 @@ function reduceMetamask(state, action) {
|
|||||||
}
|
}
|
||||||
return newState
|
return newState
|
||||||
|
|
||||||
|
case actions.SHOW_NEW_VAULT_SEED:
|
||||||
|
return extend(metamaskState, {
|
||||||
|
isUnlocked: true,
|
||||||
|
isInitialized: false,
|
||||||
|
})
|
||||||
|
|
||||||
case actions.CLEAR_SEED_WORD_CACHE:
|
case actions.CLEAR_SEED_WORD_CACHE:
|
||||||
var newState = extend(metamaskState, {
|
var newState = extend(metamaskState, {
|
||||||
|
isUnlocked: true,
|
||||||
isInitialized: true,
|
isInitialized: true,
|
||||||
|
selectedAccount: action.value,
|
||||||
})
|
})
|
||||||
delete newState.seedWords
|
delete newState.seedWords
|
||||||
return newState
|
return newState
|
||||||
|
|
||||||
case actions.CREATE_NEW_VAULT_IN_PROGRESS:
|
case actions.SHOW_ACCOUNT_DETAIL:
|
||||||
return extend(metamaskState, {
|
return extend(metamaskState, {
|
||||||
isUnlocked: true,
|
selectedAccount: action.value,
|
||||||
isInitialized: true,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user