aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-04 05:32:22 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-04 05:32:22 +0800
commite6c4d63ccdaf93d8b74965d39661e80d774504d8 (patch)
tree28ba41a15fb93ac94f3ea1a8ff0dae637655119b /app/scripts/background.js
parentdcbf17af2d547ce676178bf78328d5c01135e31a (diff)
downloadtangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar.gz
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar.bz2
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar.lz
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar.xz
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.tar.zst
tangerine-wallet-browser-e6c4d63ccdaf93d8b74965d39661e80d774504d8.zip
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.
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 3c46f4693..0f9ecc1c9 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -10,6 +10,7 @@ const IdentityStore = require('./lib/idStore')
const createTxNotification = require('./lib/notifications.js').createTxNotification
const createMsgNotification = require('./lib/notifications.js').createMsgNotification
const configManager = require('./lib/config-manager-singleton')
+const messageManager = require('./lib/message-manager')
const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex
const HostStore = require('./lib/remote-store.js').HostStore
const Web3 = require('web3')
@@ -175,6 +176,8 @@ function setupControllerConnection(stream){
setSelectedAddress: idStore.setSelectedAddress.bind(idStore),
approveTransaction: idStore.approveTransaction.bind(idStore),
cancelTransaction: idStore.cancelTransaction.bind(idStore),
+ signMessage: idStore.signMessage.bind(idStore),
+ cancelMessage: idStore.cancelMessage.bind(idStore),
setLocked: idStore.setLocked.bind(idStore),
clearSeedWordCache: idStore.clearSeedWordCache.bind(idStore),
exportAccount: idStore.exportAccount.bind(idStore),
@@ -206,7 +209,10 @@ idStore.on('update', updateBadge)
function updateBadge(state){
var label = ''
var unconfTxs = configManager.unconfirmedTxs()
- var count = Object.keys(unconfTxs).length
+ var unconfTxLen = Object.keys(unconfTxs).length
+ var unconfMsgs = messageManager.unconfirmedMsgs()
+ var unconfMsgLen = Object.keys(unconfMsgs).length
+ var count = unconfTxLen + unconfMsgLen
if (count) {
label = String(count)
}