[notify] added browser notifications

This commit is contained in:
Rushabh Mehta 2015-04-15 17:37:52 +05:30
parent 9aaf15cbe7
commit 28693f87ad

View file

@ -108,13 +108,15 @@ frappe.Application = Class.extend({
// update in module views
me.update_notification_count_in_modules();
$.each(r.message.new_messages, function(i, m) {
if (Notify.needsPermission) {
Notify.requestPermission(function() { me.browser_notify(m); });
} else {
me.browser_notify(m);
}
});
if(frappe.get_route()[0] != "messages") {
$.each(r.message.new_messages, function(i, m) {
if (Notify.needsPermission) {
Notify.requestPermission(function() { me.browser_notify(m); });
} else {
me.browser_notify(m);
}
});
}
}
},
freeze: false