2016-07-21 19:45:32 +02:00
|
|
|
const extension = require('./extension')
|
2016-03-12 02:13:48 +01:00
|
|
|
|
2016-07-12 05:53:26 +02:00
|
|
|
const notifications = {
|
2016-05-24 23:59:33 +02:00
|
|
|
createUnlockRequestNotification: createUnlockRequestNotification,
|
2016-04-28 23:16:24 +02:00
|
|
|
createTxNotification: createTxNotification,
|
|
|
|
createMsgNotification: createMsgNotification,
|
|
|
|
}
|
2016-07-12 00:45:57 +02:00
|
|
|
module.exports = notifications
|
|
|
|
window.METAMASK_NOTIFIER = notifications
|
2016-03-12 02:13:48 +01:00
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
function createUnlockRequestNotification (opts) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-05-24 23:59:33 +02:00
|
|
|
}
|
|
|
|
|
2016-06-28 21:36:53 +02:00
|
|
|
function createTxNotification (state) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-04-14 00:28:44 +02:00
|
|
|
}
|
2016-04-28 23:16:24 +02:00
|
|
|
|
2016-06-28 21:36:53 +02:00
|
|
|
function createMsgNotification (state) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-06-25 02:22:27 +02:00
|
|
|
}
|
|
|
|
|
2016-08-17 00:39:40 +02:00
|
|
|
function showNotification() {
|
2016-08-17 01:46:44 +02:00
|
|
|
extension.windows.create({
|
2016-08-17 02:50:51 +02:00
|
|
|
url: 'notification.html',
|
|
|
|
type: 'detached_panel',
|
|
|
|
focused: true,
|
|
|
|
width: 360,
|
|
|
|
height: 500,
|
2016-04-28 23:16:24 +02:00
|
|
|
})
|
2016-06-25 02:22:27 +02:00
|
|
|
}
|
2016-06-23 04:28:11 +02:00
|
|
|
|