1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

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

This commit is contained in:
Thomas Huang 2018-02-20 17:49:31 -08:00
commit 3fb9e04f5f
7 changed files with 31 additions and 37 deletions

View File

@ -56,7 +56,7 @@ class NonceTracker {
const blockTracker = this._getBlockTracker() const blockTracker = this._getBlockTracker()
const currentBlock = blockTracker.getCurrentBlock() const currentBlock = blockTracker.getCurrentBlock()
if (currentBlock) return currentBlock if (currentBlock) return currentBlock
return await Promise((reject, resolve) => { return await new Promise((reject, resolve) => {
blockTracker.once('latest', resolve) blockTracker.once('latest', resolve)
}) })
} }

View File

@ -7,7 +7,6 @@ import NoticeScreen from './notice-screen'
import BackupPhraseScreen from './backup-phrase-screen' import BackupPhraseScreen from './backup-phrase-screen'
import ImportAccountScreen from './import-account-screen' import ImportAccountScreen from './import-account-screen'
import ImportSeedPhraseScreen from './import-seed-phrase-screen' import ImportSeedPhraseScreen from './import-seed-phrase-screen'
const Loading = require('../../../../ui/app/components/loading')
import { import {
onboardingBuyEthView, onboardingBuyEthView,
unMarkPasswordForgotten, unMarkPasswordForgotten,
@ -85,15 +84,9 @@ class FirstTimeFlow extends Component {
address, address,
restoreCreatePasswordScreen, restoreCreatePasswordScreen,
forgottenPassword, forgottenPassword,
isLoading,
leaveImportSeedScreenState, leaveImportSeedScreenState,
} = this.props } = this.props
// Disable until testing bug resolved
// if (isLoading) {
// return (<Loading />)
// }
switch (this.state.screenType) { switch (this.state.screenType) {
case SCREEN_TYPE.CREATE_PASSWORD: case SCREEN_TYPE.CREATE_PASSWORD:
return ( return (
@ -164,9 +157,6 @@ export default connect(
noActiveNotices, noActiveNotices,
selectedAddress, selectedAddress,
forgottenPassword, forgottenPassword,
},
appState: {
isLoading,
} }
}) => ({ }) => ({
isInitialized, isInitialized,
@ -174,7 +164,6 @@ export default connect(
noActiveNotices, noActiveNotices,
address: selectedAddress, address: selectedAddress,
forgottenPassword, forgottenPassword,
isLoading,
}), }),
dispatch => ({ dispatch => ({
leaveImportSeedScreenState: () => dispatch(unMarkPasswordForgotten()), leaveImportSeedScreenState: () => dispatch(unMarkPasswordForgotten()),

View File

@ -6,6 +6,7 @@ import debounce from 'lodash.debounce'
import {markNoticeRead} from '../../../../ui/app/actions' import {markNoticeRead} from '../../../../ui/app/actions'
import Identicon from '../../../../ui/app/components/identicon' import Identicon from '../../../../ui/app/components/identicon'
import Breadcrumbs from './breadcrumbs' import Breadcrumbs from './breadcrumbs'
import LoadingScreen from './loading-screen'
class NoticeScreen extends Component { class NoticeScreen extends Component {
static propTypes = { static propTypes = {
@ -55,36 +56,39 @@ class NoticeScreen extends Component {
const { const {
address, address,
lastUnreadNotice: { title, body }, lastUnreadNotice: { title, body },
isLoading,
} = this.props } = this.props
const { atBottom } = this.state const { atBottom } = this.state
return ( return (
<div isLoading
className="tou" ? <LoadingScreen />
onScroll={this.onScroll} : <div
> className="tou"
<Identicon address={address} diameter={70} /> onScroll={this.onScroll}
<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 <Identicon address={address} diameter={70} />
</button> <div className="tou__title">{title}</div>
<Breadcrumbs total={3} currentIndex={2} /> <Markdown
</div> 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( export default connect(
({ metamask: { selectedAddress, lastUnreadNotice } }) => ({ ({ metamask: { selectedAddress, lastUnreadNotice }, appState: { isLoading } }) => ({
lastUnreadNotice, lastUnreadNotice,
address: selectedAddress, address: selectedAddress,
}), }),

View File

@ -456,7 +456,9 @@ App.prototype.renderPrimary = function () {
// notices // notices
if (!props.noActiveNotices) { if (!props.noActiveNotices) {
log.debug('rendering notice screen for unread notices.') log.debug('rendering notice screen for unread notices.')
return h('div', [ return h('div', {
style: { width: '100%' },
}, [
h(NoticeScreen, { h(NoticeScreen, {
notice: props.lastUnreadNotice, notice: props.lastUnreadNotice,

View File

@ -60,7 +60,8 @@ PendingTx.prototype.render = function () {
// Gas // Gas
const gas = txParams.gas const gas = txParams.gas
const gasBn = hexToBn(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 safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20) const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
const safeGasLimit = safeGasLimitBN.toString(10) const safeGasLimit = safeGasLimitBN.toString(10)

View File

@ -853,7 +853,6 @@ function markPasswordForgotten () {
function unMarkPasswordForgotten () { function unMarkPasswordForgotten () {
return (dispatch) => { return (dispatch) => {
return background.unMarkPasswordForgotten(() => { return background.unMarkPasswordForgotten(() => {
dispatch(actions.hideLoadingIndication())
dispatch(actions.forgotPassword()) dispatch(actions.forgotPassword())
forceUpdateMetamaskState(dispatch) forceUpdateMetamaskState(dispatch)
}) })

View File

@ -105,8 +105,7 @@ Notice.prototype.render = function () {
h('button.primary', { h('button.primary', {
disabled, disabled,
onClick: () => { onClick: () => {
this.setState({disclaimerDisabled: true}) this.setState({disclaimerDisabled: true}, () => onConfirm())
onConfirm()
}, },
style: { style: {
marginTop: '18px', marginTop: '18px',