diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-04 07:02:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 07:02:58 +0800 |
commit | bd99bc2e88b44b13ca818fbba478bd74eef222e3 (patch) | |
tree | 8a653f7015c89305d5c1d35ffc70ab52a30ddb0c /ui/app | |
parent | ac4868170f4c61d13291389d01bf1002fe240ed4 (diff) | |
parent | f12504cd09f136fb5ac0d4dd2a6afab8fa6e6524 (diff) | |
download | tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.gz tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.bz2 tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.lz tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.xz tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.zst tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.zip |
Merge branch 'master' into NewUI-flat
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/actions.js | 16 | ||||
-rw-r--r-- | ui/app/app.js | 1 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item.js | 28 | ||||
-rw-r--r-- | ui/app/info.js | 7 |
4 files changed, 31 insertions, 21 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 630b6390c..7b0b0d9c5 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -145,8 +145,6 @@ var actions = { SET_RPC_TARGET: 'SET_RPC_TARGET', SET_DEFAULT_RPC_TARGET: 'SET_DEFAULT_RPC_TARGET', SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE', - USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER', - useEtherscanProvider: useEtherscanProvider, showConfigPage, SHOW_ADD_TOKEN_PAGE: 'SHOW_ADD_TOKEN_PAGE', showAddTokenPage, @@ -156,7 +154,6 @@ var actions = { updateTokens, UPDATE_TOKENS: 'UPDATE_TOKENS', setRpcTarget: setRpcTarget, - setDefaultRpcTarget: setDefaultRpcTarget, setProviderType: setProviderType, // loading overlay SHOW_LOADING: 'SHOW_LOADING_INDICATION', @@ -864,16 +861,19 @@ function markAccountsFound () { // config // -// default rpc target refers to localhost:8545 in this instance. -function setDefaultRpcTarget () { - log.debug(`background.setDefaultRpcTarget`) +function setProviderType (type) { return (dispatch) => { - background.setDefaultRpc((err, result) => { + log.debug(`background.setProviderType`) + background.setProviderType(type, (err, result) => { if (err) { log.error(err) - return dispatch(self.displayWarning('Had a problem changing networks.')) + return dispatch(self.displayWarning('Had a problem changing networks!')) } }) + return { + type: actions.SET_PROVIDER_TYPE, + value: type, + } } } diff --git a/ui/app/app.js b/ui/app/app.js index 583497cb3..f1a671ab1 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -254,6 +254,7 @@ App.prototype.renderAppBar = function () { ) } + App.prototype.renderBackButton = function (style, justArrow = false) { var props = this.props return ( diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index a40066dc7..3ea466d24 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -133,7 +133,7 @@ function recipientField (txParams, transaction, isTx, isMsg) { }, }, [ message, - failIfFailed(transaction), + renderErrorOrWarning(transaction), ]) } @@ -141,8 +141,11 @@ function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') } -function failIfFailed (transaction) { - if (transaction.status === 'rejected') { +function renderErrorOrWarning (transaction) { + const { status, err, warning } = transaction + + // show rejected + if (status === 'rejected') { return h('span.error', ' (Rejected)') } if (transaction.err || transaction.warning) { @@ -152,14 +155,27 @@ function failIfFailed (transaction) { errFirst ? err.message : warning.message + // show error + if (err) { + const message = err.message || '' + return ( + h(Tooltip, { + title: message, + position: 'bottom', + }, [ + h(`span.error`, ` (Failed)`), + ]) + ) + } + // show warning + if (warning) { + const message = warning.message return h(Tooltip, { title: message, position: 'bottom', }, [ - h(`span.${errFirst ? 'error' : 'warning'}`, - ` (${errFirst ? 'Failed' : 'Warning'})` - ), + h(`span.warning`, ` (Warning)`), ]) } } diff --git a/ui/app/info.js b/ui/app/info.js index 4c7d4cb4c..24c211c1f 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -126,13 +126,6 @@ InfoScreen.prototype.render = function () { ]), ]), - h('div.fa.fa-slack', [ - h('a.info', { - href: 'http://slack.metamask.io', - target: '_blank', - }, 'Join the conversation on Slack'), - ]), - h('div', [ h('.fa.fa-twitter', [ h('a.info', { |