Permalink
Browse files

🚑 "BusService.isMasterTab is not a function" error fixed. Closes #717

…(thank you @andrepurnomo). Request for show notifications added.
  • Loading branch information...
RafiZz committed Jan 11, 2019
1 parent 0386cbc commit 3629f302b7641ab9c2bdd09e0435c315465e1d79
Showing with 6 additions and 1 deletion.
  1. +6 −1 web_debranding/static/src/js/native_notifications.js
@@ -15,8 +15,13 @@ odoo.define('web_debranding.native_notifications', function (require) {
if (title === _t('Yay, push notifications are enabled!') || title === _t('Permission denied')) {
content = content.replace(/Odoo/ig, odoo.debranding_new_name);
}

if (window.Notification && Notification.permission === "default") {
Notification.requestPermission();
}

if (window.Notification && Notification.permission === "granted") {
if (BusService.isMasterTab()) {
if (this.isMasterTab()) {
this._sendNativeNotification(title, content, callback);
}
} else {

0 comments on commit 3629f30

Please sign in to comment.