From c4812b3452da96c0196da4ea39ac3080b59078cb Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 15 Jul 2016 17:47:58 -0700 Subject: Triage a strange undefined balance error --- ui/app/components/pending-tx-details.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/app/components') diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index a6f72a89b..2fb0eae3f 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -28,7 +28,8 @@ PTXP.render = function () { var txParams = txData.txParams || {} var address = txParams.from || props.selectedAddress var identity = props.identities[address] || { address: address } - var balance = props.accounts[address].balance + var account = props.accounts[address] + var balance = account ? account.balance : '0x0' var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) -- cgit From 6658bea8d444281491718f8eee7bc3ae42f91b69 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 21 Jul 2016 10:45:32 -0700 Subject: Implement some cross-browser practices (#473) * Add mozilla plugin key to manifest * Move all chrome references into platform-checking module Addresses #453 * Add chrome global back to linter blacklist * Add tests --- ui/app/components/transaction-list-item.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/app/components') diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 78867fca4..796ba61ae 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -7,6 +7,7 @@ const addressSummary = require('../util').addressSummary const explorerLink = require('../../lib/explorer-link') const CopyButton = require('./copyButton') const vreme = new (require('vreme')) +const extension = require('../../../app/scripts/lib/extension') const TransactionIcon = require('./transaction-list-item-icon') @@ -49,7 +50,7 @@ TransactionListItem.prototype.render = function () { if (!transaction.hash || !isLinkable) return var url = explorerLink(transaction.hash, parseInt(network)) - chrome.tabs.create({ url }) + extension.tabs.create({ url }) }, style: { padding: '20px 0', -- cgit From 9b43ec2278a5647c427c426ed798ab90bbf093cc Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 28 Jul 2016 10:53:51 -0700 Subject: Add eth classic to provider menu --- ui/app/components/drop-menu-item.js | 14 +++++++++----- ui/app/components/network.js | 21 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 8 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js index f5800f799..8bff3e131 100644 --- a/ui/app/components/drop-menu-item.js +++ b/ui/app/components/drop-menu-item.js @@ -32,20 +32,24 @@ DropMenuItem.prototype.render = function () { } DropMenuItem.prototype.activeNetworkRender = function () { - var activeNetwork = this.props.activeNetworkRender + let activeNetwork = this.props.activeNetworkRender + let { provider } = this.props if (activeNetwork === undefined) return switch (this.props.label) { case 'Main Ethereum Network': - if (activeNetwork === '1') return h('.check', ' ✓') + if (provider.type === 'mainnet') return h('.check', '✓') + break + case 'Ethereum Classic Network': + if (provider.type === 'classic') return h('.check', '✓') break case 'Morden Test Network': - if (activeNetwork === '2') return h('.check', ' ✓') + if (activeNetwork === '2') return h('.check', '✓') break case 'Localhost 8545': - if (activeNetwork === 'http://localhost:8545') return h('.check', ' ✓') + if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') break default: - if (activeNetwork === 'custom') return h('.check', ' ✓') + if (activeNetwork === 'custom') return h('.check', '✓') } } diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 032e71699..22b11aa6c 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -11,11 +11,13 @@ function Network () { } Network.prototype.render = function () { - const state = this.props - const networkNumber = state.network + const props = this.props + const networkNumber = props.network + const providerName = props.provider.type let iconName, hoverText if (networkNumber === 'loading') { + return h('img', { title: 'Attempting to connect to blockchain.', onClick: (event) => this.props.onClick(event), @@ -25,9 +27,13 @@ Network.prototype.render = function () { }, src: 'images/loading.svg', }) - } else if (parseInt(networkNumber) === 1) { + + } else if (providerName === 'mainnet') { hoverText = 'Main Ethereum Network' iconName = 'ethereum-network' + } else if (providerName === 'classic') { + hoverText = 'Ethereum Classic Network' + iconName = 'classic-network' } else if (parseInt(networkNumber) === 2) { hoverText = 'Morden Test Network' iconName = 'morden-test-network' @@ -55,6 +61,15 @@ Network.prototype.render = function () { }}, 'Etherum Main Net'), ]) + case 'classic-network': + return h('.network-indicator', [ + h('.menu-icon.hollow-diamond'), + h('.network-name', { + style: { + color: '#039396', + }}, + 'Etherum Classic'), + ]) case 'morden-test-network': return h('.network-indicator', [ h('.menu-icon.red-dot'), -- cgit From 8a4d8eca6463d7dd846515fdd62732a419a07344 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 29 Jul 2016 12:19:15 -0700 Subject: Fix network name reference When adding the classic network to the menu, I left a reference to a property that is not always existent, so we needed a fallback for it. --- ui/app/components/network.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ui/app/components') diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 22b11aa6c..95901fe70 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -13,7 +13,12 @@ function Network () { Network.prototype.render = function () { const props = this.props const networkNumber = props.network - const providerName = props.provider.type + let providerName + try { + providerName = props.provider.type + } catch (e) { + providerName = null + } let iconName, hoverText if (networkNumber === 'loading') { -- cgit From c7691b7e64597b873da706d842e360f3e2ec8347 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 29 Jul 2016 12:22:39 -0700 Subject: Fix reference in drop menu item --- ui/app/components/drop-menu-item.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js index 8bff3e131..1a0d6cbd5 100644 --- a/ui/app/components/drop-menu-item.js +++ b/ui/app/components/drop-menu-item.js @@ -34,14 +34,15 @@ DropMenuItem.prototype.render = function () { DropMenuItem.prototype.activeNetworkRender = function () { let activeNetwork = this.props.activeNetworkRender let { provider } = this.props + let providerType = provider ? provider.type : null if (activeNetwork === undefined) return switch (this.props.label) { case 'Main Ethereum Network': - if (provider.type === 'mainnet') return h('.check', '✓') + if (providerType === 'mainnet') return h('.check', '✓') break case 'Ethereum Classic Network': - if (provider.type === 'classic') return h('.check', '✓') + if (providerType === 'classic') return h('.check', '✓') break case 'Morden Test Network': if (activeNetwork === '2') return h('.check', '✓') -- cgit