Skip to content

Instantly share code, notes, and snippets.

@BrandonSmith
Last active September 1, 2017 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrandonSmith/f40776b8698ae8f9e17a080a2243118f to your computer and use it in GitHub Desktop.
Save BrandonSmith/f40776b8698ae8f9e17a080a2243118f to your computer and use it in GitHub Desktop.
Reply sometimes does not work
const {app,Notification} = require('electron')
app.on('ready', () => {
showNextNotification()
})
let i = 0
showNextNotification = () => {
const notification = new Notification({
title: 'Tester',
body: 'Does reply work this time?',
hasReply: true
})
// A reply was submitted
notification.on(`reply`, (_, text) => {
console.log(`reply ${text}`)
showNextNotification()
})
// Notification was clicked
notification.on(`click`, () => {
console.log(`click`)
})
notification.on(`action`, (_, index) => {
console.log(`action ${index}`)
})
notification.on(`show`, () => {
console.log(`show`)
})
notification.on(`close`, () => {
console.log(`close`)
showNextNotification()
})
notification.show()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment