From 9dce2be2735b57d9c6781fbdd43725ab5f32cc5a Mon Sep 17 00:00:00 2001 From: adekock11 Date: Tue, 30 Jan 2018 12:15:37 +0200 Subject: [FIX] mail: display notification when explicitly grant it Instead of looking for the "denied" permission, rather look for the "granted" since there are three permissions: "default", "denied", "granted" - only "granted" counts toward permission actually being granted Closes #22633 --- addons/mail/static/src/js/client_action.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/mail/static/src') diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 165dda719c2..cd8889a900e 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -124,10 +124,10 @@ var ChatAction = Widget.extend(ControlPanelMixin, { var def = window.Notification && window.Notification.requestPermission(); if (def) { def.then(function (value) { - if (value === 'denied') { - utils.send_notification(_t('Permission denied'), _t('Odoo will not have the permission to send native notifications on this device.')); - } else { + if (value === 'granted') { utils.send_notification(_t('Permission granted'), _t('Odoo has now the permission to send you native notifications on this device.')); + } else { + utils.send_notification(_t('Permission denied'), _t('Odoo will not have the permission to send native notifications on this device.')); } }); } -- cgit v1.2.3