From 70e8a1b3ae96672c4da35f4640fa6184405c9f85 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 3 Aug 2020 15:21:11 +0200 Subject: [PATCH] Fix errors happening in mobile framework --- api/js/jsapi/egw_notification.js | 3 +++ notifications/js/notificationajaxpopup.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/js/jsapi/egw_notification.js b/api/js/jsapi/egw_notification.js index 7aa9399ad2..32add97b8c 100644 --- a/api/js/jsapi/egw_notification.js +++ b/api/js/jsapi/egw_notification.js @@ -108,6 +108,9 @@ egw.extend('notification', egw.MODULE_WND_LOCAL, function(_app, _wnd) * @returns {Boolean} true if notification is supported and permitted otherwise false */ checkNotification: function () { + // Check if the notification is supported by browser + if (typeof Notification == 'undefined') return false; + // Ask for permission if there's nothing decided yet if (Notification && Notification.requestPermission && permission == 'default') { Notification.requestPermission (function(_permission){ diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index f003accf09..1a16052f24 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -855,7 +855,7 @@ { for (var app in apps) { - framework.notifyAppTab(app, apps[app]); + if (framework.notifyAppTab) framework.notifyAppTab(app, apps[app]); } $topmenu_info_notifications.addClass('egwpopup_notify');