fix Notification not being available crash

This commit is contained in:
Nicholas Matlaga 2017-10-05 11:45:01 -04:00
parent 4b9db9570c
commit 5ecaa9daca

View file

@ -369,7 +369,7 @@ function onNewLine(text, originator) {
unread++;
favico.badge(unread);
document.title = "(" + unread + ") " + originalTitle;
if ("Notification" in window){
if (("notification_popup" in options) && (options["notification_popup"])) {
Notification.requestPermission().then(function(result) {
if(result === "granted") {
@ -394,6 +394,7 @@ function onNewLine(text, originator) {
}
}
}
}
// User clicked on a dialog to drag it
function doStartDragDialog(event) {
@ -427,7 +428,9 @@ function doStartDragDialog(event) {
// Event when client finishes loading
$(document).ready(function() {
if ("Notification" in window) {
Notification.requestPermission();
}
favico = new Favico({
animation: 'none'