fix Notification not being available crash
This commit is contained in:
parent
4b9db9570c
commit
5ecaa9daca
1 changed files with 24 additions and 21 deletions
|
|
@ -369,7 +369,7 @@ function onNewLine(text, originator) {
|
||||||
unread++;
|
unread++;
|
||||||
favico.badge(unread);
|
favico.badge(unread);
|
||||||
document.title = "(" + unread + ") " + originalTitle;
|
document.title = "(" + unread + ") " + originalTitle;
|
||||||
|
if ("Notification" in window){
|
||||||
if (("notification_popup" in options) && (options["notification_popup"])) {
|
if (("notification_popup" in options) && (options["notification_popup"])) {
|
||||||
Notification.requestPermission().then(function(result) {
|
Notification.requestPermission().then(function(result) {
|
||||||
if(result === "granted") {
|
if(result === "granted") {
|
||||||
|
|
@ -394,6 +394,7 @@ function onNewLine(text, originator) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// User clicked on a dialog to drag it
|
// User clicked on a dialog to drag it
|
||||||
function doStartDragDialog(event) {
|
function doStartDragDialog(event) {
|
||||||
|
|
@ -427,7 +428,9 @@ function doStartDragDialog(event) {
|
||||||
// Event when client finishes loading
|
// Event when client finishes loading
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
if ("Notification" in window) {
|
||||||
Notification.requestPermission();
|
Notification.requestPermission();
|
||||||
|
}
|
||||||
|
|
||||||
favico = new Favico({
|
favico = new Favico({
|
||||||
animation: 'none'
|
animation: 'none'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue