diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-06-29 04:13:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-29 04:13:20 +0800 |
commit | 913533522f650e340a369103f2d8018a92ad9bc1 (patch) | |
tree | 608d036f502353db83d69ad4500fa0d6cf980f97 /app/scripts/lib/notifications.js | |
parent | d4708828aa780ad3995ef61d6ec8d5130639751b (diff) | |
parent | 4777f82ae065bf630c1f1bdc0eb64eacfb4181de (diff) | |
download | tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar.gz tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar.bz2 tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar.lz tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar.xz tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.tar.zst tangerine-wallet-browser-913533522f650e340a369103f2d8018a92ad9bc1.zip |
Merge pull request #350 from MetaMask/notif2
Notifications - improved readability and data
Diffstat (limited to 'app/scripts/lib/notifications.js')
-rw-r--r-- | app/scripts/lib/notifications.js | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index a7c21855d..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), })) |