fix(MessageHandler): suppress the notifications on top of the overlay

This commit is contained in:
paweldomas 2016-10-13 11:14:56 -05:00
parent 52344ff741
commit 210605d8f3
4 changed files with 26 additions and 7 deletions

View File

@ -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();
};
/**

View File

@ -23,6 +23,14 @@ function buildOverlayHtml(browser) {
}
export default {
/**
* Checks whether the overlay is currently visible.
* @return {boolean} <tt>true</tt> if the overlay is visible
* or <tt>false</tt> 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');
},
/**

View File

@ -86,6 +86,14 @@ function start(timeoutSeconds) {
}
export default {
/**
* Checks whether the page reload overlay has been displayed.
* @return {boolean} <tt>true</tt> if the page reload overlay is currently
* visible or <tt>false</tt> 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);
}

View File

@ -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 = '<span class="nickname" ';