aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-12 13:21:10 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-12 13:21:10 +0800
commit29facfe4d6194fe519c906983682a655f8fb6406 (patch)
treed2f910a48ff61c4a12c4c7059027686bc3b1b8d0 /ui
parentb628df017f14c38f68c3048ef503ce8722f07f3b (diff)
downloadtangerine-wallet-browser-29facfe4d6194fe519c906983682a655f8fb6406.tar.gz
tangerine-wallet-browser-29facfe4d6194fe519c906983682a655f8fb6406.tar.zst
tangerine-wallet-browser-29facfe4d6194fe519c906983682a655f8fb6406.zip
Fix more transition bugs
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js13
-rw-r--r--ui/app/app.js9
-rw-r--r--ui/app/first-time/init-menu.js34
-rw-r--r--ui/app/reducers/app.js9
-rw-r--r--ui/app/reducers/metamask.js13
5 files changed, 26 insertions, 52 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index dbcf3e577..45af35e67 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -312,19 +312,20 @@ function backToAccountDetail(address) {
value: address,
}
}
-function clearSeedWordCache() {
+function clearSeedWordCache(account) {
return {
- type: this.CLEAR_SEED_WORD_CACHE
+ type: this.CLEAR_SEED_WORD_CACHE,
+ value: account,
}
}
function confirmSeedWords() {
return (dispatch) => {
dispatch(this.showLoadingIndication())
- _accountManager.clearSeedWordCache((err, accounts) => {
- dispatch(this.clearSeedWordCache())
- console.log('Seed word cache cleared.')
- dispatch(this.showAccountDetail(accounts[0].address))
+ _accountManager.clearSeedWordCache((err, account) => {
+ dispatch(this.clearSeedWordCache(account))
+ console.log('Seed word cache cleared. ' + account)
+ dispatch(this.showAccountDetail(account))
})
}
}
diff --git a/ui/app/app.js b/ui/app/app.js
index 388a067f0..cec3a9657 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -157,12 +157,9 @@ App.prototype.toggleMetamaskActive = function(){
App.prototype.renderPrimary = function(state){
var state = this.props
- // If seed words haven't been dismissed yet, show them still.
- /*
if (state.seedWords) {
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
}
- */
// show initialize screen
if (!state.isInitialized) {
@@ -176,6 +173,9 @@ App.prototype.renderPrimary = function(state){
case 'restoreVault':
return h(RestoreVaultScreen, {key: 'restoreVault'})
+ case 'createVaultComplete':
+ return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
+
default:
return h(InitializeMenuScreen, {key: 'menuScreenInit'})
@@ -190,9 +190,6 @@ App.prototype.renderPrimary = function(state){
// show current view
switch (state.currentView.name) {
- case 'createVaultComplete':
- return h(CreateVaultCompleteScreen, {key: 'created-vault'})
-
case 'accounts':
return h(AccountsScreen, {key: 'accounts'})
diff --git a/ui/app/first-time/init-menu.js b/ui/app/first-time/init-menu.js
index 11b01a88b..6ea2eec90 100644
--- a/ui/app/first-time/init-menu.js
+++ b/ui/app/first-time/init-menu.js
@@ -29,15 +29,6 @@ InitializeMenuScreen.prototype.render = function() {
switch (state.currentView.name) {
- case 'createVault':
- return h(CreateVaultScreen)
-
- case 'createVaultComplete':
- return h(CreateVaultCompleteScreen)
-
- case 'restoreVault':
- return this.renderRestoreVault()
-
default:
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() {
// this.props.dispatch(actions.showInitializeMenu())
// }
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 309351956..0e0740c9d 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -278,10 +278,13 @@ function reduceApp(state, action) {
case actions.CLEAR_SEED_WORD_CACHE:
return extend(appState, {
transForward: true,
- currentView: {
- name: 'accounts',
- },
+ currentView: {},
isLoading: false,
+ accountDetail: {
+ subview: 'transactions',
+ accountExport: 'none',
+ privateKey: '',
+ },
})
case actions.DISPLAY_WARNING:
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 9398f1497..8bf5c8aae 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -69,17 +69,24 @@ function reduceMetamask(state, action) {
}
return newState
+ case actions.SHOW_NEW_VAULT_SEED:
+ return extend(metamaskState, {
+ isUnlocked: true,
+ isInitialized: false,
+ })
+
case actions.CLEAR_SEED_WORD_CACHE:
var newState = extend(metamaskState, {
+ isUnlocked: true,
isInitialized: true,
+ selectedAccount: action.value,
})
delete newState.seedWords
return newState
- case actions.CREATE_NEW_VAULT_IN_PROGRESS:
+ case actions.SHOW_ACCOUNT_DETAIL:
return extend(metamaskState, {
- isUnlocked: true,
- isInitialized: true,
+ selectedAccount: action.value,
})
default: