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 () { UI.isOverlayVisible = function () {
return RingOverlay.isVisible(); return RingOverlay.isVisible()
|| PageReloadOverlay.isVisible()
|| GumPermissionsOverlay.isVisible();
}; };
/** /**

View File

@ -23,6 +23,14 @@ function buildOverlayHtml(browser) {
} }
export default { 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 * Shows browser-specific overlay with guidance how to proceed with
* gUM prompt. * gUM prompt.
@ -32,7 +40,7 @@ export default {
show(browser) { show(browser) {
!$overlay && buildOverlayHtml(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 { 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 * Shows the page reload overlay which will do the conference reload after
* the given amount of time. * the given amount of time.
@ -97,7 +105,7 @@ export default {
!$overlay && buildReloadOverlayHtml(); !$overlay && buildReloadOverlayHtml();
if (!$overlay.parents('body').length) { if (!this.isVisible()) {
$overlay.appendTo('body'); $overlay.appendTo('body');
start(timeoutSeconds); start(timeoutSeconds);
} }

View File

@ -333,7 +333,7 @@ var messageHandler = {
messageArguments, options) { messageArguments, options) {
// If we're in ringing state we skip all toaster notifications. // If we're in ringing state we skip all toaster notifications.
if(!notificationsEnabled || APP.UI.isRingOverlayVisible()) if(!notificationsEnabled || APP.UI.isOverlayVisible())
return; return;
var displayNameSpan = '<span class="nickname" '; var displayNameSpan = '<span class="nickname" ';