[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
This commit is contained in:
@@ -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.'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user