From c82d7585b824f7617d3765036b2d9d82b49c3493 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 28 Jun 2016 12:36:53 -0700 Subject: background - prepare state for notifcations --- app/scripts/lib/notifications.js | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 2a058db75..2f97f22ac 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), })) -- cgit v1.2.3