aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js32
-rw-r--r--app/scripts/lib/notifications.js49
2 files changed, 35 insertions, 46 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 97e3269ba..28285fd70 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -30,21 +30,37 @@ function unlockAccountMessage () {
}
function showUnconfirmedMessage (msgParams, msgId) {
+ var controllerState = controller.getState()
+
createMsgNotification({
- title: 'New Unsigned Message',
- msgParams: msgParams,
- confirm: idStore.approveMessage.bind(idStore, msgId, noop),
- cancel: idStore.cancelMessage.bind(idStore, msgId),
+ imageifyIdenticons: false,
+ txData: {
+ msgParams: msgParams,
+ time: (new Date()).getTime(),
+ },
+ identities: controllerState.identities,
+ accounts: controllerState.accounts,
+ onConfirm: idStore.approveMessage.bind(idStore, msgId, noop),
+ onCancel: idStore.cancelMessage.bind(idStore, msgId),
})
+
}
function showUnconfirmedTx (txParams, txData, onTxDoneCb) {
+ var controllerState = controller.getState()
+
createTxNotification({
- title: 'New Unsigned Transaction',
- txParams: txParams,
- confirm: idStore.approveTransaction.bind(idStore, txData.id, noop),
- cancel: idStore.cancelTransaction.bind(idStore, txData.id),
+ imageifyIdenticons: false,
+ txData: {
+ txParams: txParams,
+ time: (new Date()).getTime(),
+ },
+ identities: controllerState.identities,
+ accounts: controllerState.accounts,
+ onConfirm: idStore.approveTransaction.bind(idStore, txData.id, noop),
+ onCancel: idStore.cancelTransaction.bind(idStore, txData.id),
})
+
}
//
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index a31949108..35ee5b6d7 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -53,62 +53,30 @@ function createUnlockRequestNotification (opts) {
})
}
-function createTxNotification (opts) {
+function createTxNotification (state) {
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
- var state = {
- title: 'New Unsigned Transaction',
- imageifyIdenticons: false,
- txData: {
- txParams: opts.txParams,
- time: (new Date()).getTime(),
- },
- identities: {
-
- },
- accounts: {
-
- },
- onConfirm: opts.confirm,
- onCancel: opts.cancel,
- }
-
renderTxNotificationSVG(state, function(err, notificationSvgSource){
if (err) throw err
showNotification(extend(state, {
+ title: 'New Unsigned Transaction',
imageUrl: toSvgUri(notificationSvgSource),
}))
})
}
-function createMsgNotification (opts) {
+function createMsgNotification (state) {
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
- var state = {
- title: 'New Unsigned Message',
- imageifyIdenticons: false,
- txData: {
- msgParams: opts.msgParams,
- time: (new Date()).getTime(),
- },
- identities: {
-
- },
- accounts: {
-
- },
- onConfirm: opts.confirm,
- onCancel: opts.cancel,
- }
-
renderMsgNotificationSVG(state, function(err, notificationSvgSource){
if (err) throw err
showNotification(extend(state, {
+ title: 'New Unsigned Message',
imageUrl: toSvgUri(notificationSvgSource),
}))
@@ -154,8 +122,8 @@ function renderNotificationSVG(content, cb){
var container = document.createElement('div')
var confirmView = h('div.app-primary', {
style: {
- width: '450px',
- height: '300px',
+ width: '360px',
+ height: '240px',
padding: '16px',
// background: '#F7F7F7',
background: 'white',
@@ -176,8 +144,13 @@ function renderNotificationSVG(content, cb){
}
function svgWrapper(content){
+<<<<<<< HEAD
+ var wrapperSource = `
+ <svg xmlns="http://www.w3.org/2000/svg" width="360" height="240">
+=======
var wrapperSource = `
<svg xmlns="http://www.w3.org/2000/svg" width="450" height="300">
+>>>>>>> master
<foreignObject x="0" y="0" width="100%" height="100%">
<body xmlns="http://www.w3.org/1999/xhtml" height="100%">{{content}}</body>
</foreignObject>