Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecated callback using with the promise one #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions notification-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Notification.requestPermission();
// Get current notification icon
icon = "notifications.png"

function modifyIcon(icon_path) {
logger.icon = icon_path;
}
Expand All @@ -15,12 +15,20 @@
} else if (Notification.permission === "granted") {
new Notification(title ,{body: body, icon: logger.icon});
} else if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
Notification.requestPermission().then(function(result) {
if (result === 'denied') {
console.log('Permission wasn\'t granted. Allow a retry.');
return;
}
if (result === 'default') {
console.log('The permission request was dismissed.');
return;
}
if (permission === "granted") {
new Notification(title ,{body: body});
}
});
}
});
}
}

function originalFnCallDecorator(fn, fnName) {
Expand Down