You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2021/03/03 08:30:44 UTC

[openmeetings] branch master updated: [OPENMEETINGS-2583] Safari specific code for Notifications

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new fa81f18  [OPENMEETINGS-2583] Safari specific code for Notifications
fa81f18 is described below

commit fa81f18955f83df6894b4628ecaf85041e2dac0f
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Wed Mar 3 15:30:27 2021 +0700

    [OPENMEETINGS-2583] Safari specific code for Notifications
---
 openmeetings-web/src/main/front/main/src/omutils.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/openmeetings-web/src/main/front/main/src/omutils.js b/openmeetings-web/src/main/front/main/src/omutils.js
index d70d9b7..09ef4b0 100644
--- a/openmeetings-web/src/main/front/main/src/omutils.js
+++ b/openmeetings-web/src/main/front/main/src/omutils.js
@@ -49,11 +49,16 @@ function _sendMessage(_m, _base) {
 }
 function _requestNotifyPermission(callback, elseCallback) {
 	if (Notification.permission !== 'granted' && Notification.permission !== 'denied') {
-		Notification.requestPermission().then(permission => {
+		function onRequest(permission) {
 			if (permission === 'granted') {
 				callback();
 			}
-		});
+		}
+		if (VideoUtil.browser.name === 'Safari') {
+			Notification.requestPermission(onRequest);
+		} else {
+			Notification.requestPermission().then(onRequest);
+		}
 	} else if (typeof(elseCallback) === 'function') {
 		elseCallback();
 	}