From e6c4d63ccdaf93d8b74965d39661e80d774504d8 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 3 May 2016 14:32:22 -0700 Subject: Add UI for Signing Messages Calls to `eth.sign` are now transiently persisted in memory, and displayed in a chronological stack with pending transactions (which are still persisted to disk). This allows the user a method to sign/cancel transactions even if they miss the Chrome notification. Improved a lot of the view routing, to avoid cases where routes would show an empty account view, or transition to the accounts list when it shouldn't. Broke the transaction approval view into a couple components so messages and transactions could have their own templates. --- ui/app/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index fa375fb7f..fce98d8e1 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -202,7 +202,7 @@ App.prototype.renderPrimary = function(state){ return h(CreateVaultScreen, {key: 'createVault'}) default: - return h(AccountsScreen, {key: 'accounts'}) + return h(AccountDetailScreen, {key: 'account-detail'}) } } -- cgit v1.2.3 From 9c6ec054b13f24e88b78ca4124b0d3a46234b1d7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 3 May 2016 15:04:15 -0700 Subject: Show any pending txs when unlocking Before the unlock action hard-routed to the home route, now it has a condition where it will show pending transactions instead. --- ui/app/app.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index fce98d8e1..94c72a3c8 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -23,6 +23,7 @@ const ConfirmTxScreen = require('./conf-tx') const ConfigScreen = require('./config') const InfoScreen = require('./info') const LoadingIndicator = require('./loading') +const txHelper = require('../lib/tx-helper') module.exports = connect(mapStateToProps)(App) @@ -39,6 +40,8 @@ function mapStateToProps(state) { activeAddress: state.appState.activeAddress, transForward: state.appState.transForward, seedWords: state.metamask.seedWords, + unconfTxs: state.metamask.unconfTxs, + unconfMsgs: state.metamask.unconfMsgs, } } @@ -202,8 +205,20 @@ App.prototype.renderPrimary = function(state){ return h(CreateVaultScreen, {key: 'createVault'}) default: - return h(AccountDetailScreen, {key: 'account-detail'}) - } + if (this.hasPendingTxs()) { + return h(ConfirmTxScreen, {key: 'confirm-tx'}) + } else { + return h(AccountDetailScreen, {key: 'account-detail'}) + } + } +} + +App.prototype.hasPendingTxs = function() { + var state = this.props + var unconfTxs = state.unconfTxs + var unconfMsgs = state.unconfMsgs + var unconfTxList = txHelper(unconfTxs, unconfMsgs) + return unconfTxList.length > 0 } function onOffToggle(state){ -- cgit v1.2.3