mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix illegal return statement :(
This commit is contained in:
parent
c04d33c6a5
commit
90f494c9a1
@ -8,24 +8,30 @@ module.exports = {
|
|||||||
createMsgNotification: createMsgNotification,
|
createMsgNotification: createMsgNotification,
|
||||||
}
|
}
|
||||||
|
|
||||||
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
|
setupListeners()
|
||||||
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
|
|
||||||
|
|
||||||
// notification button press
|
function setupListeners(){
|
||||||
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex){
|
|
||||||
var handlers = notificationHandlers[notificationId]
|
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
|
||||||
if (buttonIndex === 0) {
|
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
|
||||||
handlers.confirm()
|
|
||||||
} else {
|
|
||||||
handlers.cancel()
|
|
||||||
}
|
|
||||||
chrome.notifications.clear(notificationId)
|
|
||||||
})
|
|
||||||
|
|
||||||
// notification teardown
|
// notification button press
|
||||||
chrome.notifications.onClosed.addListener(function(notificationId){
|
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex){
|
||||||
delete notificationHandlers[notificationId]
|
var handlers = notificationHandlers[notificationId]
|
||||||
})
|
if (buttonIndex === 0) {
|
||||||
|
handlers.confirm()
|
||||||
|
} else {
|
||||||
|
handlers.cancel()
|
||||||
|
}
|
||||||
|
chrome.notifications.clear(notificationId)
|
||||||
|
})
|
||||||
|
|
||||||
|
// notification teardown
|
||||||
|
chrome.notifications.onClosed.addListener(function(notificationId){
|
||||||
|
delete notificationHandlers[notificationId]
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// creation helper
|
// creation helper
|
||||||
function createUnlockRequestNotification(opts){
|
function createUnlockRequestNotification(opts){
|
||||||
|
Loading…
Reference in New Issue
Block a user