diff options
Diffstat (limited to 'addons/mail_bot/static/src/models/messaging/messaging.js')
| -rw-r--r-- | addons/mail_bot/static/src/models/messaging/messaging.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/mail_bot/static/src/models/messaging/messaging.js b/addons/mail_bot/static/src/models/messaging/messaging.js new file mode 100644 index 00000000000..a95171ccf69 --- /dev/null +++ b/addons/mail_bot/static/src/models/messaging/messaging.js @@ -0,0 +1,22 @@ +odoo.define('mail_bot/static/src/models/messaging/messaging.js', function (require) { +'use strict'; + +const { registerInstancePatchModel } = require('mail/static/src/model/model_core.js'); + +registerInstancePatchModel('mail.messaging', 'mail_bot/static/src/models/messaging/messaging.js', { + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + /** + * @returns {boolean} + */ + isNotificationPermissionDefault() { + const windowNotification = this.env.browser.Notification; + return windowNotification + ? windowNotification.permission === 'default' + : false; + }, +}); + +}); |
