Browse Source

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

master
paweldomas 8 years ago
parent
commit
210605d8f3

+ 7
- 4
modules/UI/UI.js View File

1450
 };
1450
 };
1451
 
1451
 
1452
 /**
1452
 /**
1453
- * Indicates if the ring overlay is currently visible.
1453
+ * Indicates if any the "top" overlays are currently visible. The check includes
1454
+ * the call overlay, GUM permissions overlay and a page reload overlay.
1454
  *
1455
  *
1455
- * @returns {*|boolean} {true} if the ring overlay is visible, {false} otherwise
1456
+ * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1456
  */
1457
  */
1457
-UI.isRingOverlayVisible = function () {
1458
-    return RingOverlay.isVisible();
1458
+UI.isOverlayVisible = function () {
1459
+    return RingOverlay.isVisible()
1460
+        || PageReloadOverlay.isVisible()
1461
+        || GumPermissionsOverlay.isVisible();
1459
 };
1462
 };
1460
 
1463
 
1461
 /**
1464
 /**

+ 9
- 1
modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js View File

23
 }
23
 }
24
 
24
 
25
 export default {
25
 export default {
26
+    /**
27
+     * Checks whether the overlay is currently visible.
28
+     * @return {boolean} <tt>true</tt> if the overlay is visible
29
+     * or <tt>false</tt> otherwise.
30
+     */
31
+    isVisible () {
32
+        return $overlay && $overlay.parents('body').length > 0;
33
+    },
26
     /**
34
     /**
27
      * Shows browser-specific overlay with guidance how to proceed with
35
      * Shows browser-specific overlay with guidance how to proceed with
28
      * gUM prompt.
36
      * gUM prompt.
32
     show(browser) {
40
     show(browser) {
33
         !$overlay && buildOverlayHtml(browser);
41
         !$overlay && buildOverlayHtml(browser);
34
 
42
 
35
-        !$overlay.parents('body').length && $overlay.appendTo('body');
43
+        !this.isVisible() && $overlay.appendTo('body');
36
     },
44
     },
37
 
45
 
38
     /**
46
     /**

+ 9
- 1
modules/UI/reload_overlay/PageReloadOverlay.js View File

86
 }
86
 }
87
 
87
 
88
 export default {
88
 export default {
89
+    /**
90
+     * Checks whether the page reload overlay has been displayed.
91
+     * @return {boolean} <tt>true</tt> if the page reload overlay is currently
92
+     * visible or <tt>false</tt> otherwise.
93
+     */
94
+    isVisible() {
95
+        return $overlay && $overlay.parents('body').length > 0;
96
+    },
89
     /**
97
     /**
90
      * Shows the page reload overlay which will do the conference reload after
98
      * Shows the page reload overlay which will do the conference reload after
91
      * the given amount of time.
99
      * the given amount of time.
97
 
105
 
98
         !$overlay && buildReloadOverlayHtml();
106
         !$overlay && buildReloadOverlayHtml();
99
 
107
 
100
-        if (!$overlay.parents('body').length) {
108
+        if (!this.isVisible()) {
101
             $overlay.appendTo('body');
109
             $overlay.appendTo('body');
102
             start(timeoutSeconds);
110
             start(timeoutSeconds);
103
         }
111
         }

+ 1
- 1
modules/UI/util/MessageHandler.js View File

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

Loading…
Cancel
Save