Hides notification after X amount of seconds

This commit is contained in:
Phil Hughes 2016-04-06 15:06:27 +01:00
parent 99fe9c7b77
commit 552cde76fa
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,11 @@
notificationGranted = (message, opts, onclick) -> notificationGranted = (message, opts, onclick) ->
notification = new Notification(message, opts) notification = new Notification(message, opts)
# Hide the notification after X amount of seconds
setTimeout ->
notification.close()
, 8000
if onclick if onclick
notification.onclick = onclick notification.onclick = onclick