aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-11-02 13:19:04 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-11-02 13:19:04 +0800
commit8f3db0dbc0bafdc604bd7359bd41370f594c792c (patch)
tree6f9ce947f83a7c6dddf5803c39e69be044c11273 /ui
parentf2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7 (diff)
downloadtangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar.gz
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar.bz2
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar.lz
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar.xz
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.tar.zst
tangerine-wallet-browser-8f3db0dbc0bafdc604bd7359bd41370f594c792c.zip
Add reveal of seed words.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js23
-rw-r--r--ui/app/app.js4
-rw-r--r--ui/app/config.js16
3 files changed, 43 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 8218e05ef..070ba2da0 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -30,6 +30,10 @@ var actions = {
addNewAccount,
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',
@@ -213,6 +217,25 @@ function createNewVaultAndKeychain (password, entropy) {
}
}
+function revealSeedConfirmation () {
+ return {
+ type: this.REVEAL_SEED_CONFIRMATION,
+ }
+}
+
+function requestRevealSeed (password) {
+ return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
+ background.submitPassword(password, (err, newState) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) return dispatch(actions.displayWarning(err.message))
+ background.placeSeedWords()
+ dispatch(actions.showNewVaultSeed())
+ })
+ }
+}
+
+
function addNewKeyring (type, opts) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
diff --git a/ui/app/app.js b/ui/app/app.js
index 4b1818b93..a2532c153 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -28,6 +28,7 @@ const BuyView = require('./components/buy-button-subview')
const QrView = require('./components/qr-code')
const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete')
const HDRestoreVaultScreen = require('./keychains/hd/restore-vault')
+const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation')
module.exports = connect(mapStateToProps)(App)
@@ -411,6 +412,9 @@ 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'})
diff --git a/ui/app/config.js b/ui/app/config.js
index d4730e558..e09a38cd8 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -77,6 +77,22 @@ 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'),
+ ]),
+
]),
]),
])