aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-06-03 07:59:02 +0800
committerkumavis <aaron@kumavis.me>2016-06-03 07:59:02 +0800
commitc04d33c6a54dfb5c6ba779a79e19d8f06910ed9f (patch)
tree225a5aa3d6ceb09285f156d81e0cff8c209f9cb2 /app/scripts
parent01e63d41ede22a7290553f888261583d22b24eda (diff)
downloadtangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar.gz
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar.bz2
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar.lz
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar.xz
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.tar.zst
tangerine-wallet-browser-c04d33c6a54dfb5c6ba779a79e19d8f06910ed9f.zip
hotfix for #236 - chrome notif api not avail
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/notifications.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index d011d778b..b72939196 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -8,6 +8,9 @@ module.exports = {
createMsgNotification: createMsgNotification,
}
+// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
+if (!chrome.notifications) return console.error('Chrome notifications API missing...')
+
// notification button press
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex){
var handlers = notificationHandlers[notificationId]
@@ -26,6 +29,8 @@ chrome.notifications.onClosed.addListener(function(notificationId){
// creation helper
function createUnlockRequestNotification(opts){
+ // guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
+ if (!chrome.notifications) return console.error('Chrome notifications API missing...')
var message = 'An Ethereum app has requested a signature. Please unlock your account.'
var id = createId()
@@ -39,6 +44,8 @@ function createUnlockRequestNotification(opts){
}
function createTxNotification(opts){
+ // guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
+ if (!chrome.notifications) return console.error('Chrome notifications API missing...')
var message = [
'Submitted by '+opts.txParams.origin,
'to: '+uiUtils.addressSummary(opts.txParams.to),
@@ -67,6 +74,8 @@ function createTxNotification(opts){
}
function createMsgNotification(opts){
+ // guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
+ if (!chrome.notifications) return console.error('Chrome notifications API missing...')
var message = [
'Submitted by '+opts.msgParams.origin,
'to be signed by: '+uiUtils.addressSummary(opts.msgParams.from),