aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/ducks
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-07-26 21:35:21 +0800
committerGitHub <noreply@github.com>2019-07-26 21:35:21 +0800
commit1112277cd628378f8b0e659067456677ec9a45ac (patch)
tree77a4d1878ba8419a0e7400f9147bb67f44b4a177 /ui/app/ducks
parent58965ed1643a816dca1fec608671017266709dda (diff)
downloadtangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.tar.gz
tangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.tar.zst
tangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.zip
Remove `seedWords` completely from metamask state (#6920)
`seedWords` used to be stored on the metamask state temporarily at certain points. This hasn't been the case since #5994, but references to this state remained. All of the logic remained for correctly updating these `seedWords`, handling them during navigation, and scrubbing them from the state. However the state was never updated in practice. The `seedWords` are still returned by `verifySeedPhrase`, and they're still stored in component state in a few places. But they aren't ever set in the Redux metadata state or the Preferences controller. All references to this state have been removed, along with any logic for interacting with this state. A few unused actions were removed as well.
Diffstat (limited to 'ui/app/ducks')
-rw-r--r--ui/app/ducks/app/app.js22
-rw-r--r--ui/app/ducks/index.js9
-rw-r--r--ui/app/ducks/metamask/metamask.js17
3 files changed, 3 insertions, 45 deletions
diff --git a/ui/app/ducks/app/app.js b/ui/app/ducks/app/app.js
index 04c8c7422..77d9116e5 100644
--- a/ui/app/ducks/app/app.js
+++ b/ui/app/ducks/app/app.js
@@ -27,13 +27,6 @@ function reduceApp (state, action) {
context: selectedAddress,
}
- // confirm seed words
- var seedWords = state.metamask.seedWords
- var seedConfView = {
- name: 'createVaultComplete',
- seedWords,
- }
-
// default state
var appState = extend({
shouldClose: false,
@@ -58,7 +51,7 @@ function reduceApp (state, action) {
alertMessage: null,
qrCodeData: null,
networkDropdownOpen: false,
- currentView: seedWords ? seedConfView : defaultView,
+ currentView: defaultView,
accountDetail: {
subview: 'transactions',
},
@@ -279,16 +272,6 @@ function reduceApp (state, action) {
isLoading: true,
})
- case actions.SHOW_NEW_VAULT_SEED:
- return extend(appState, {
- currentView: {
- name: 'createVaultComplete',
- seedWords: action.value,
- },
- transForward: true,
- isLoading: false,
- })
-
case actions.NEW_ACCOUNT_SCREEN:
return extend(appState, {
currentView: {
@@ -428,8 +411,7 @@ function reduceApp (state, action) {
case actions.SHOW_ACCOUNTS_PAGE:
return extend(appState, {
currentView: {
- name: seedWords ? 'createVaultComplete' : 'accounts',
- seedWords,
+ name: 'accounts',
},
transForward: true,
isLoading: false,
diff --git a/ui/app/ducks/index.js b/ui/app/ducks/index.js
index 2d33edcfa..18470c441 100644
--- a/ui/app/ducks/index.js
+++ b/ui/app/ducks/index.js
@@ -61,9 +61,6 @@ window.getCleanAppState = function () {
// append additional information
state.version = global.platform.getVersion()
state.browser = window.navigator.userAgent
- // ensure seedWords are not included
- if (state.metamask) delete state.metamask.seedWords
- if (state.appState.currentView) delete state.appState.currentView.seedWords
return state
}
@@ -72,7 +69,7 @@ window.logStateString = function (cb) {
global.platform.getPlatformInfo((err, platform) => {
if (err) return cb(err)
state.platform = platform
- const stateString = JSON.stringify(state, removeSeedWords, 2)
+ const stateString = JSON.stringify(state, null, 2)
cb(null, stateString)
})
}
@@ -89,7 +86,3 @@ window.logState = function (toClipboard) {
}
})
}
-
-function removeSeedWords (key, value) {
- return key === 'seedWords' ? undefined : value
-}
diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js
index 64ce064b9..92f190cf1 100644
--- a/ui/app/ducks/metamask/metamask.js
+++ b/ui/app/ducks/metamask/metamask.js
@@ -44,7 +44,6 @@ function reduceMetamask (state, action) {
useBlockie: false,
featureFlags: {},
networkEndpointType: OLD_UI_NETWORK_TYPE,
- isRevealingSeedWords: false,
welcomeScreenSeen: false,
currentLocale: '',
preferences: {
@@ -60,13 +59,6 @@ function reduceMetamask (state, action) {
switch (action.type) {
- case actions.SHOW_ACCOUNTS_PAGE:
- newState = extend(metamaskState, {
- isRevealingSeedWords: false,
- })
- delete newState.seedWords
- return newState
-
case actions.UPDATE_METAMASK_STATE:
return extend(metamaskState, action.value)
@@ -128,20 +120,12 @@ function reduceMetamask (state, action) {
},
})
-
- case actions.SHOW_NEW_VAULT_SEED:
- return extend(metamaskState, {
- isRevealingSeedWords: true,
- seedWords: action.value,
- })
-
case actions.CLEAR_SEED_WORD_CACHE:
newState = extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
selectedAddress: action.value,
})
- delete newState.seedWords
return newState
case actions.SHOW_ACCOUNT_DETAIL:
@@ -150,7 +134,6 @@ function reduceMetamask (state, action) {
isInitialized: true,
selectedAddress: action.value,
})
- delete newState.seedWords
return newState
case actions.SET_SELECTED_TOKEN: