reformat
parent
1181dd3e76
commit
923fc872af
|
@ -326,16 +326,20 @@ window.addEventListener('blur', function() {
|
|||
lichess.isPageVisible = false;
|
||||
});
|
||||
lichess.desktopNotification = function(msg) {
|
||||
if (lichess.isPageVisible || !("Notification" in window) || Notification.permission === "denied") return;
|
||||
if (Notification.permission === "granted") {
|
||||
var notification = new Notification("lichess", {body: msg});
|
||||
} else {
|
||||
Notification.requestPermission(function (permission) {
|
||||
if (permission === "granted") {
|
||||
var notification = new Notification("lichess", {body: msg});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (lichess.isPageVisible || !("Notification" in window) || Notification.permission === "denied") return;
|
||||
if (Notification.permission === "granted") {
|
||||
var notification = new Notification("lichess", {
|
||||
body: msg
|
||||
});
|
||||
} else {
|
||||
Notification.requestPermission(function(permission) {
|
||||
if (permission === "granted") {
|
||||
var notification = new Notification("lichess", {
|
||||
body: msg
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
|
Loading…
Reference in New Issue