diff options
author | Thomas Huang <thomas.b.huang@gmail.com> | 2018-02-21 09:49:31 +0800 |
---|---|---|
committer | Thomas Huang <thomas.b.huang@gmail.com> | 2018-02-21 09:49:31 +0800 |
commit | 3fb9e04f5ff8c762c85cfc2386c555868a7b794d (patch) | |
tree | 6cabe45b24906776c91a11933a41c605daadce73 | |
parent | f2f47956973852bc055c50f226cf57e65c458855 (diff) | |
parent | b1b97727313eaa3a375541e85f43b5f2253ad6de (diff) | |
download | tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar.gz tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar.bz2 tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar.lz tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar.xz tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.tar.zst tangerine-wallet-browser-3fb9e04f5ff8c762c85cfc2386c555868a7b794d.zip |
Merge branch 'MM-806-new-ui-first-time-import-seed-in-popup' of https://github.com/danjm/metamask-extension into MM-806-new-ui-first-time-import-seed-in-popup
-rw-r--r-- | app/scripts/lib/nonce-tracker.js | 2 | ||||
-rw-r--r-- | mascara/src/app/first-time/index.js | 11 | ||||
-rw-r--r-- | mascara/src/app/first-time/notice-screen.js | 44 | ||||
-rw-r--r-- | old-ui/app/app.js | 4 | ||||
-rw-r--r-- | old-ui/app/components/pending-tx.js | 3 | ||||
-rw-r--r-- | ui/app/actions.js | 1 | ||||
-rw-r--r-- | ui/app/components/notice.js | 3 |
7 files changed, 31 insertions, 37 deletions
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js index 0029ac953..ed9dd3f11 100644 --- a/app/scripts/lib/nonce-tracker.js +++ b/app/scripts/lib/nonce-tracker.js @@ -56,7 +56,7 @@ class NonceTracker { const blockTracker = this._getBlockTracker() const currentBlock = blockTracker.getCurrentBlock() if (currentBlock) return currentBlock - return await Promise((reject, resolve) => { + return await new Promise((reject, resolve) => { blockTracker.once('latest', resolve) }) } diff --git a/mascara/src/app/first-time/index.js b/mascara/src/app/first-time/index.js index 46b821c8b..da2f6bab9 100644 --- a/mascara/src/app/first-time/index.js +++ b/mascara/src/app/first-time/index.js @@ -7,7 +7,6 @@ import NoticeScreen from './notice-screen' import BackupPhraseScreen from './backup-phrase-screen' import ImportAccountScreen from './import-account-screen' import ImportSeedPhraseScreen from './import-seed-phrase-screen' -const Loading = require('../../../../ui/app/components/loading') import { onboardingBuyEthView, unMarkPasswordForgotten, @@ -85,15 +84,9 @@ class FirstTimeFlow extends Component { address, restoreCreatePasswordScreen, forgottenPassword, - isLoading, leaveImportSeedScreenState, } = this.props - // Disable until testing bug resolved - // if (isLoading) { - // return (<Loading />) - // } - switch (this.state.screenType) { case SCREEN_TYPE.CREATE_PASSWORD: return ( @@ -164,9 +157,6 @@ export default connect( noActiveNotices, selectedAddress, forgottenPassword, - }, - appState: { - isLoading, } }) => ({ isInitialized, @@ -174,7 +164,6 @@ export default connect( noActiveNotices, address: selectedAddress, forgottenPassword, - isLoading, }), dispatch => ({ leaveImportSeedScreenState: () => dispatch(unMarkPasswordForgotten()), diff --git a/mascara/src/app/first-time/notice-screen.js b/mascara/src/app/first-time/notice-screen.js index e691a2f47..0f0a7e95d 100644 --- a/mascara/src/app/first-time/notice-screen.js +++ b/mascara/src/app/first-time/notice-screen.js @@ -6,6 +6,7 @@ import debounce from 'lodash.debounce' import {markNoticeRead} from '../../../../ui/app/actions' import Identicon from '../../../../ui/app/components/identicon' import Breadcrumbs from './breadcrumbs' +import LoadingScreen from './loading-screen' class NoticeScreen extends Component { static propTypes = { @@ -55,36 +56,39 @@ class NoticeScreen extends Component { const { address, lastUnreadNotice: { title, body }, + isLoading, } = this.props const { atBottom } = this.state return ( - <div - className="tou" - onScroll={this.onScroll} - > - <Identicon address={address} diameter={70} /> - <div className="tou__title">{title}</div> - <Markdown - className="tou__body markdown" - source={body} - skipHtml - /> - <button - className="first-time-flow__button" - onClick={atBottom && this.acceptTerms} - disabled={!atBottom} + isLoading + ? <LoadingScreen /> + : <div + className="tou" + onScroll={this.onScroll} > - Accept - </button> - <Breadcrumbs total={3} currentIndex={2} /> - </div> + <Identicon address={address} diameter={70} /> + <div className="tou__title">{title}</div> + <Markdown + className="tou__body markdown" + source={body} + skipHtml + /> + <button + className="first-time-flow__button" + onClick={atBottom && this.acceptTerms} + disabled={!atBottom} + > + Accept + </button> + <Breadcrumbs total={3} currentIndex={2} /> + </div> ) } } export default connect( - ({ metamask: { selectedAddress, lastUnreadNotice } }) => ({ + ({ metamask: { selectedAddress, lastUnreadNotice }, appState: { isLoading } }) => ({ lastUnreadNotice, address: selectedAddress, }), diff --git a/old-ui/app/app.js b/old-ui/app/app.js index 61f6223bc..c79ac633a 100644 --- a/old-ui/app/app.js +++ b/old-ui/app/app.js @@ -456,7 +456,9 @@ App.prototype.renderPrimary = function () { // notices if (!props.noActiveNotices) { log.debug('rendering notice screen for unread notices.') - return h('div', [ + return h('div', { + style: { width: '100%' }, + }, [ h(NoticeScreen, { notice: props.lastUnreadNotice, diff --git a/old-ui/app/components/pending-tx.js b/old-ui/app/components/pending-tx.js index 10208b5ce..720df2243 100644 --- a/old-ui/app/components/pending-tx.js +++ b/old-ui/app/components/pending-tx.js @@ -60,7 +60,8 @@ PendingTx.prototype.render = function () { // Gas const gas = txParams.gas const gasBn = hexToBn(gas) - const gasLimit = new BN(parseInt(blockGasLimit)) + // default to 8MM gas limit + const gasLimit = new BN(parseInt(blockGasLimit) || '8000000') const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20) const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20) const safeGasLimit = safeGasLimitBN.toString(10) diff --git a/ui/app/actions.js b/ui/app/actions.js index 4bc1f379e..64d5b67e0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -853,7 +853,6 @@ function markPasswordForgotten () { function unMarkPasswordForgotten () { return (dispatch) => { return background.unMarkPasswordForgotten(() => { - dispatch(actions.hideLoadingIndication()) dispatch(actions.forgotPassword()) forceUpdateMetamaskState(dispatch) }) diff --git a/ui/app/components/notice.js b/ui/app/components/notice.js index 941ac33e6..9d2e89cb0 100644 --- a/ui/app/components/notice.js +++ b/ui/app/components/notice.js @@ -105,8 +105,7 @@ Notice.prototype.render = function () { h('button.primary', { disabled, onClick: () => { - this.setState({disclaimerDisabled: true}) - onConfirm() + this.setState({disclaimerDisabled: true}, () => onConfirm()) }, style: { marginTop: '18px', |