aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-02-24 06:17:52 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-02-24 06:17:52 +0800
commit30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5 (patch)
tree831a0441622eb017e64dc9a8c513c82b2a8f7c08 /ui
parent6b56d6ba9853ec978cd2d3d030882fa5ee3645cd (diff)
parent09c7b9d242f66db99c80f22fae00dfdb894e2adc (diff)
downloadtangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar.gz
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar.bz2
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar.lz
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar.xz
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.tar.zst
tangerine-wallet-browser-30e4bdf24b30c9a59a86d7b7890af66ffd0e83c5.zip
Merge github.com:MetaMask/metamask-plugin into i765-gaslimits
Diffstat (limited to 'ui')
-rw-r--r--ui/app/app.js22
-rw-r--r--ui/app/components/notice.js13
-rw-r--r--ui/app/conf-tx.js5
-rw-r--r--ui/index.js4
-rw-r--r--ui/lib/tx-helper.js5
5 files changed, 46 insertions, 3 deletions
diff --git a/ui/app/app.js b/ui/app/app.js
index ea755bec5..6e249b09e 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -350,13 +350,15 @@ App.prototype.renderPrimary = function () {
var props = this.props
// notices
- if (!props.noActiveNotices && !global.METAMASK_DEBUG) {
+ if (!props.noActiveNotices) {
+ log.debug('rendering notice screen for unread notices.')
return h(NoticeScreen, {
notice: props.lastUnreadNotice,
key: 'NoticeScreen',
onConfirm: () => props.dispatch(actions.markNoticeRead(props.lastUnreadNotice)),
})
} else if (props.lostAccounts && props.lostAccounts.length > 0) {
+ log.debug('rendering notice screen for lost accounts view.')
return h(NoticeScreen, {
notice: generateLostAccountsNotice(props.lostAccounts),
key: 'LostAccountsNotice',
@@ -365,18 +367,22 @@ 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
+ log.debug('rendering an initialize screen')
switch (props.currentView.name) {
case 'restoreVault':
+ log.debug('rendering restore vault screen')
return h(HDRestoreVaultScreen, {key: 'HDRestoreVaultScreen'})
default:
+ log.debug('rendering menu screen')
return h(InitializeMenuScreen, {key: 'menuScreenInit'})
}
}
@@ -386,9 +392,11 @@ App.prototype.renderPrimary = function () {
switch (props.currentView.name) {
case 'restoreVault':
+ log.debug('rendering restore vault screen')
return h(HDRestoreVaultScreen, {key: 'HDRestoreVaultScreen'})
default:
+ log.debug('rendering locked screen')
return h(UnlockScreen, {key: 'locked'})
}
}
@@ -397,36 +405,47 @@ App.prototype.renderPrimary = function () {
switch (props.currentView.name) {
case 'accounts':
+ log.debug('rendering accounts screen')
return h(AccountsScreen, {key: 'accounts'})
case 'accountDetail':
+ log.debug('rendering account detail screen')
return h(AccountDetailScreen, {key: 'account-detail'})
case 'sendTransaction':
+ log.debug('rendering send tx screen')
return h(SendTransactionScreen, {key: 'send-transaction'})
case 'newKeychain':
+ log.debug('rendering new keychain screen')
return h(NewKeyChainScreen, {key: 'new-keychain'})
case 'confTx':
+ log.debug('rendering confirm tx screen')
return h(ConfirmTxScreen, {key: 'confirm-tx'})
case 'config':
+ log.debug('rendering config screen')
return h(ConfigScreen, {key: 'config'})
case 'import-menu':
+ log.debug('rendering import screen')
return h(Import, {key: 'import-menu'})
case 'reveal-seed-conf':
+ log.debug('rendering reveal seed confirmation screen')
return h(RevealSeedConfirmation, {key: 'reveal-seed-conf'})
case 'info':
+ log.debug('rendering info screen')
return h(InfoScreen, {key: 'info'})
case 'buyEth':
+ log.debug('rendering buy ether screen')
return h(BuyView, {key: 'buyEthView'})
case 'qr':
+ log.debug('rendering show qr screen')
return h('div', {
style: {
position: 'absolute',
@@ -454,6 +473,7 @@ App.prototype.renderPrimary = function () {
])
default:
+ log.debug('rendering default, account detail screen')
return h(AccountDetailScreen, {key: 'account-detail'})
}
}
diff --git a/ui/app/components/notice.js b/ui/app/components/notice.js
index 00db734d7..23ded9d5d 100644
--- a/ui/app/components/notice.js
+++ b/ui/app/components/notice.js
@@ -15,10 +15,12 @@ function Notice () {
Notice.prototype.render = function () {
const { notice, onConfirm } = this.props
const { title, date, body } = notice
+ const state = this.state || { disclaimerDisabled: true }
+ const disabled = state.disclaimerDisabled
return (
h('.flex-column.flex-center.flex-grow', [
- h('h3.flex-center.text-transform-uppercacse.terms-header', {
+ h('h3.flex-center.text-transform-uppercase.terms-header', {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
@@ -31,7 +33,7 @@ Notice.prototype.render = function () {
title,
]),
- h('h5.flex-center.text-transform-uppercacse.terms-header', {
+ h('h5.flex-center.text-transform-uppercase.terms-header', {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
@@ -74,6 +76,12 @@ Notice.prototype.render = function () {
`),
h('div.markdown', {
+ onScroll: (e) => {
+ var object = e.currentTarget
+ if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) {
+ this.setState({disclaimerDisabled: false})
+ }
+ },
style: {
background: 'rgb(235, 235, 235)',
height: '310px',
@@ -90,6 +98,7 @@ Notice.prototype.render = function () {
]),
h('button', {
+ disabled,
onClick: onConfirm,
style: {
marginTop: '18px',
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index 831bed0ec..0bf308990 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -47,6 +47,8 @@ ConfirmTxScreen.prototype.render = function () {
var txData = unconfTxList[index] || {}
var txParams = txData.params || {}
var isNotification = isPopupOrNotification() === 'notification'
+
+ log.info(`rendering a combined ${unconfTxList.length} unconf msg & txs`)
if (unconfTxList.length === 0) return null
return (
@@ -120,11 +122,14 @@ function currentTxView (opts) {
const { txData } = opts
const { txParams, msgParams } = txData
+ log.info('rendering current tx view')
if (txParams) {
// This is a pending transaction
+ log.debug('txParams detected, rendering pending tx')
return h(PendingTx, opts)
} else if (msgParams) {
// This is a pending message to sign
+ log.debug('msgParams detected, rendering pending msg')
return h(PendingMsg, opts)
}
}
diff --git a/ui/index.js b/ui/index.js
index 8855064f6..844e6c417 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -6,6 +6,10 @@ const configureStore = require('./app/store')
const txHelper = require('./lib/tx-helper')
module.exports = launchApp
+const log = require('loglevel')
+window.log = log
+log.setLevel('warn')
+
function launchApp (opts) {
var accountManager = opts.accountManager
actions._setBackgroundConnection(accountManager)
diff --git a/ui/lib/tx-helper.js b/ui/lib/tx-helper.js
index fa7a94cdc..7f64f9fbe 100644
--- a/ui/lib/tx-helper.js
+++ b/ui/lib/tx-helper.js
@@ -1,8 +1,13 @@
const valuesFor = require('../app/util').valuesFor
module.exports = function (unapprovedTxs, unapprovedMsgs, network) {
+ log.debug('tx-helper called with params:')
+ log.debug({ unapprovedTxs, unapprovedMsgs, network })
+
var txValues = network ? valuesFor(unapprovedTxs).filter(tx => tx.txParams.metamaskNetworkId === network) : valuesFor(unapprovedTxs)
+ log.debug(`tx helper found ${txValues.length} unapproved txs`)
var msgValues = valuesFor(unapprovedMsgs)
+ log.debug(`tx helper found ${msgValues.length} unsigned messages`)
var allValues = txValues.concat(msgValues)
return allValues.sort(tx => tx.time)
}