[FIX] mail: error notification safari iphone 7
On safari iphone 7 (and possibly other browsers) we could have an error by referencing to an undeclared Notification variable. opw-726084
This commit is contained in:
@@ -121,7 +121,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
|
||||
"click .o_mail_request_permission": function (event) {
|
||||
event.preventDefault();
|
||||
this.$(".o_mail_annoying_notification_bar").slideUp();
|
||||
var def = window.Notification.requestPermission();
|
||||
var def = window.Notification && window.Notification.requestPermission();
|
||||
if (def) {
|
||||
def.then(function (value) {
|
||||
if (value === 'denied') {
|
||||
|
||||
@@ -7,7 +7,7 @@ var web_client = require('web.web_client');
|
||||
|
||||
|
||||
function send_notification(title, content) {
|
||||
if (Notification && Notification.permission === "granted") {
|
||||
if (window.Notification && Notification.permission === "granted") {
|
||||
if (bus.is_master) {
|
||||
_send_native_notification(title, content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user