diff options
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/account-detail.js | 1 | ||||
-rw-r--r-- | ui/app/app.js | 13 | ||||
-rw-r--r-- | ui/app/components/loading.js | 12 | ||||
-rw-r--r-- | ui/app/components/network.js | 2 | ||||
-rw-r--r-- | ui/app/conf-tx.js | 10 | ||||
-rw-r--r-- | ui/app/css/index.css | 2 | ||||
-rw-r--r-- | ui/app/info.js | 7 | ||||
-rw-r--r-- | ui/app/keychains/hd/restore-vault.js | 4 | ||||
-rw-r--r-- | ui/app/send.js | 18 | ||||
-rw-r--r-- | ui/app/util.js | 3 |
10 files changed, 59 insertions, 13 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index d4f707e0b..c9a8a774d 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -161,6 +161,7 @@ AccountDetailScreen.prototype.render = function () { textOverflow: 'ellipsis', paddingTop: '3px', width: '5em', + height: '15px', fontSize: '13px', fontFamily: 'Montserrat Light', textRendering: 'geometricPrecision', diff --git a/ui/app/app.js b/ui/app/app.js index bd0ccb0a2..f0dfef34f 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -395,7 +395,7 @@ App.prototype.renderDropdown = function () { h(DropdownMenuItem, { closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), onClick: () => { this.props.dispatch(actions.lockMetamask()) }, - }, 'Lock'), + }, 'Log Out'), h(DropdownMenuItem, { closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), @@ -460,11 +460,6 @@ App.prototype.renderPrimary = function () { }) } - if (props.seedWords) { - log.debug('rendering seed words') - return h(HDCreateVaultComplete, {key: 'HDCreateVaultComplete'}) - } - // show initialize screen if (!props.isInitialized || props.forgottenPassword) { // show current view @@ -499,6 +494,12 @@ App.prototype.renderPrimary = function () { } } + // show seed words screen + if (props.seedWords) { + log.debug('rendering seed words') + return h(HDCreateVaultComplete, {key: 'HDCreateVaultComplete'}) + } + // show current view switch (props.currentView.name) { diff --git a/ui/app/components/loading.js b/ui/app/components/loading.js index 163792584..b8e2eb599 100644 --- a/ui/app/components/loading.js +++ b/ui/app/components/loading.js @@ -11,7 +11,7 @@ function LoadingIndicator () { } LoadingIndicator.prototype.render = function () { - const { isLoading, loadingMessage } = this.props + const { isLoading, loadingMessage, canBypass, bypass } = this.props return ( isLoading ? h('.full-flex-height', { @@ -28,6 +28,16 @@ LoadingIndicator.prototype.render = function () { background: 'rgba(255, 255, 255, 0.8)', }, }, [ + canBypass ? h( 'i.fa.fa-close.cursor-pointer.close-loading', { + style: { + position: 'absolute', + top: '1px', + right: '15px', + color: '#AEAEAE', + }, + onClick: bypass, + }) : null, + h('img', { src: 'images/loading.svg', }), diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 0dbe37cdd..18fca1db7 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -22,7 +22,7 @@ Network.prototype.render = function () { let iconName, hoverText if (networkNumber === 'loading') { - return h('span.pointer', { + return h('span.pointer.network-indicator', { style: { display: 'flex', alignItems: 'center', diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index cb1afedfe..9c8f98fa8 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -4,6 +4,7 @@ const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('./actions') const NetworkIndicator = require('./components/network') +const LoadingIndicator = require('./components/loading') const txHelper = require('../lib/tx-helper') const isPopupOrNotification = require('../../app/scripts/lib/is-popup-or-notification') @@ -60,6 +61,15 @@ ConfirmTxScreen.prototype.render = function () { h('.flex-column.flex-grow', [ + h(LoadingIndicator, { + isLoading: this.state ? !this.state.bypassLoadingScreen : txData.loadingDefaults, + loadingMessage: 'Estimating transaction cost…', + canBypass: true, + bypass: () => { + this.setState({bypassLoadingScreen: true}) + }, + }), + // subtitle and nav h('.section-title.flex-row.flex-center', [ !isNotification ? h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', { diff --git a/ui/app/css/index.css b/ui/app/css/index.css index c0bf18c23..b40d48b5d 100644 --- a/ui/app/css/index.css +++ b/ui/app/css/index.css @@ -441,7 +441,9 @@ input.large-input { .account-detail-section { display: flex; flex-wrap: wrap; + overflow-x: hidden; overflow-y: auto; + max-height: 465px; flex-direction: inherit; } diff --git a/ui/app/info.js b/ui/app/info.js index 24c211c1f..49ff9f24a 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -103,9 +103,9 @@ InfoScreen.prototype.render = function () { [ h('div.fa.fa-support', [ h('a.info', { - href: 'https://support.metamask.io', + href: 'https://metamask.helpscoutdocs.com/', target: '_blank', - }, 'Visit our Support Center'), + }, 'Visit our Knowledge Base'), ]), h('div', [ @@ -138,8 +138,7 @@ InfoScreen.prototype.render = function () { h('div.fa.fa-envelope', [ h('a.info', { target: '_blank', - style: { width: '85vw' }, - href: 'mailto:help@metamask.io?subject=Feedback', + href: 'mailto:support@metamask.io?subject=MetaMask Support', }, 'Email us!'), ]), ]), diff --git a/ui/app/keychains/hd/restore-vault.js b/ui/app/keychains/hd/restore-vault.js index 06e51d9b3..24b37a83d 100644 --- a/ui/app/keychains/hd/restore-vault.js +++ b/ui/app/keychains/hd/restore-vault.js @@ -149,4 +149,8 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () { this.warning = null this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.createNewVaultAndRestore(password, seed)) + .catch((err) => { + log.error(err.message) + }) + } diff --git a/ui/app/send.js b/ui/app/send.js index e59c1130e..09c9e03d4 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -247,10 +247,26 @@ SendTransactionScreen.prototype.onSubmit = function () { const recipient = state.recipient || document.querySelector('input[name="address"]').value.replace(/^[.\s]+|[.\s]+$/g, '') const nickname = state.nickname || ' ' const input = document.querySelector('input[name="amount"]').value + const parts = input.split('') + + let message + + if (isNaN(input) || input === '') { + message = 'Invalid ether value.' + return this.props.dispatch(actions.displayWarning(message)) + } + + if (parts[1]) { + var decimal = parts[1] + if (decimal.length > 18) { + message = 'Ether amount is too precise.' + return this.props.dispatch(actions.displayWarning(message)) + } + } + const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value const balance = this.props.balance - let message if (value.gt(balance)) { message = 'Insufficient funds.' diff --git a/ui/app/util.js b/ui/app/util.js index 3f8b4dcc3..293f4228c 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -193,6 +193,9 @@ function normalizeEthStringToWei (str) { while (decimal.length < 18) { decimal += '0' } + if (decimal.length > 18) { + decimal = decimal.slice(0, 18) + } const decimalBN = new ethUtil.BN(decimal, 10) eth = eth.add(decimalBN) } |