diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index ea289baef..144fef378 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -1450,12 +1450,15 @@ UI.hideRingOverLay = function () {
};
/**
- * Indicates if the ring overlay is currently visible.
+ * Indicates if any the "top" overlays are currently visible. The check includes
+ * the call overlay, GUM permissions overlay and a page reload overlay.
*
- * @returns {*|boolean} {true} if the ring overlay is visible, {false} otherwise
+ * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
*/
-UI.isRingOverlayVisible = function () {
- return RingOverlay.isVisible();
+UI.isOverlayVisible = function () {
+ return RingOverlay.isVisible()
+ || PageReloadOverlay.isVisible()
+ || GumPermissionsOverlay.isVisible();
};
/**
diff --git a/modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js b/modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js
index 55b3bf902..d25880ba2 100644
--- a/modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js
+++ b/modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js
@@ -23,6 +23,14 @@ function buildOverlayHtml(browser) {
}
export default {
+ /**
+ * Checks whether the overlay is currently visible.
+ * @return {boolean} true if the overlay is visible
+ * or false otherwise.
+ */
+ isVisible () {
+ return $overlay && $overlay.parents('body').length > 0;
+ },
/**
* Shows browser-specific overlay with guidance how to proceed with
* gUM prompt.
@@ -32,7 +40,7 @@ export default {
show(browser) {
!$overlay && buildOverlayHtml(browser);
- !$overlay.parents('body').length && $overlay.appendTo('body');
+ !this.isVisible() && $overlay.appendTo('body');
},
/**
diff --git a/modules/UI/reload_overlay/PageReloadOverlay.js b/modules/UI/reload_overlay/PageReloadOverlay.js
index 21edbbd5e..15436597b 100644
--- a/modules/UI/reload_overlay/PageReloadOverlay.js
+++ b/modules/UI/reload_overlay/PageReloadOverlay.js
@@ -86,6 +86,14 @@ function start(timeoutSeconds) {
}
export default {
+ /**
+ * Checks whether the page reload overlay has been displayed.
+ * @return {boolean} true if the page reload overlay is currently
+ * visible or false otherwise.
+ */
+ isVisible() {
+ return $overlay && $overlay.parents('body').length > 0;
+ },
/**
* Shows the page reload overlay which will do the conference reload after
* the given amount of time.
@@ -97,7 +105,7 @@ export default {
!$overlay && buildReloadOverlayHtml();
- if (!$overlay.parents('body').length) {
+ if (!this.isVisible()) {
$overlay.appendTo('body');
start(timeoutSeconds);
}
diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js
index 319a459e3..0a478a599 100644
--- a/modules/UI/util/MessageHandler.js
+++ b/modules/UI/util/MessageHandler.js
@@ -333,7 +333,7 @@ var messageHandler = {
messageArguments, options) {
// If we're in ringing state we skip all toaster notifications.
- if(!notificationsEnabled || APP.UI.isRingOverlayVisible())
+ if(!notificationsEnabled || APP.UI.isOverlayVisible())
return;
var displayNameSpan = '