diff options
author | Jacky Chan <jchan@uber.com> | 2017-08-21 19:56:09 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 12:51:37 +0800 |
commit | e1497fafa64b5f8e25407611709920dc5e0eaf77 (patch) | |
tree | 11f1b6eaddf131e4c733ec990ef67b476d6a86db /ui | |
parent | 4e446410eb76c1bd5d27b6dd4f413bfbf3df0e2d (diff) | |
download | tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar.gz tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar.bz2 tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar.lz tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar.xz tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.tar.zst tangerine-wallet-browser-e1497fafa64b5f8e25407611709920dc5e0eaf77.zip |
Add UniqueImageScreen
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/actions.js | 27 | ||||
-rw-r--r-- | ui/app/app.js | 24 |
2 files changed, 30 insertions, 21 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 84990922e..11cd14c16 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -243,19 +243,26 @@ function createNewVaultAndKeychain (password) { return (dispatch) => { dispatch(actions.showLoadingIndication()) log.debug(`background.createNewVaultAndKeychain`) - background.createNewVaultAndKeychain(password, (err) => { - if (err) { - return dispatch(actions.displayWarning(err.message)) - } - log.debug(`background.placeSeedWords`) - background.placeSeedWords((err) => { + + return new Promise((resolve, reject) => { + background.createNewVaultAndKeychain(password, (err) => { if (err) { - return dispatch(actions.displayWarning(err.message)) + dispatch(actions.displayWarning(err.message)) + return reject(err) } - dispatch(actions.hideLoadingIndication()) - forceUpdateMetamaskState(dispatch) + log.debug(`background.placeSeedWords`) + background.placeSeedWords((err) => { + if (err) { + dispatch(actions.displayWarning(err.message)) + return reject(err) + } + dispatch(actions.hideLoadingIndication()) + forceUpdateMetamaskState(dispatch) + resolve() + }) }) - }) + }); + } } diff --git a/ui/app/app.js b/ui/app/app.js index 57e3d3366..ec36eb22e 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -106,10 +106,7 @@ App.prototype.render = function () { this.renderNetworkDropdown(), this.renderDropdown(), - h(Loading, { - isLoading: isLoading || isLoadingNetwork, - loadingMessage: loadMessage, - }), + this.renderLoadingIndicator({ isLoading, isLoadingNetwork, loadMessage }), // panel content h('.app-primary' + (transForward ? '.from-right' : '.from-left'), { @@ -401,6 +398,17 @@ App.prototype.renderDropdown = function () { ]) } +App.prototype.renderLoadingIndicator = function({ isLoading, isLoadingNetwork, loadMessage }) { + const { isMascara } = this.props; + + return isMascara + ? null + : h(Loading, { + isLoading: isLoading || isLoadingNetwork, + loadingMessage: loadMessage, + }) +} + App.prototype.renderBackButton = function (style, justArrow = false) { var props = this.props return ( @@ -420,19 +428,13 @@ App.prototype.renderBackButton = function (style, justArrow = false) { ) } -App.prototype.renderMascaraFirstTime = function () { - return 'hi' -} - App.prototype.renderPrimary = function () { log.debug('rendering primary') var props = this.props const {isMascara, isOnboarding} = props if (isMascara && isOnboarding) { - return h(MascaraFirstTime, { - screenType: MascaraFirstTime.getScreenType(props) - }) + return h(MascaraFirstTime) } // notices |