[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:
Nicolas Lempereur
2017-04-13 13:56:57 +02:00
parent d59555abb5
commit 671bd703bf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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') {
+1 -1
View File
@@ -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);
}