瀏覽代碼

notifications: hdie all (visual) notifications for SIP gateways

j8
Saúl Ibarra Corretgé 5 年之前
父節點
當前提交
cdbc5976a0
共有 1 個檔案被更改,包括 31 行新增2 行删除
  1. 31
    2
      react/features/notifications/components/web/NotificationsContainer.js

+ 31
- 2
react/features/notifications/components/web/NotificationsContainer.js 查看文件

@@ -6,12 +6,20 @@ import React from 'react';
6 6
 import { connect } from '../../../base/redux';
7 7
 
8 8
 import AbstractNotificationsContainer, {
9
-    _abstractMapStateToProps as _mapStateToProps,
10
-    type Props
9
+    _abstractMapStateToProps,
10
+    type Props as AbstractProps
11 11
 } from '../AbstractNotificationsContainer';
12 12
 
13 13
 import Notification from './Notification';
14 14
 
15
+type Props = AbstractProps & {
16
+
17
+    /**
18
+     * Whther we are a SIP gateway or not.
19
+     */
20
+     _iAmSipGateway: boolean
21
+};
22
+
15 23
 /**
16 24
  * Implements a React {@link Component} which displays notifications and handles
17 25
  * automatic dismissmal after a notification is shown for a defined timeout
@@ -28,6 +36,10 @@ class NotificationsContainer extends AbstractNotificationsContainer<Props> {
28 36
      * @returns {ReactElement}
29 37
      */
30 38
     render() {
39
+        if (this.props._iAmSipGateway) {
40
+            return null;
41
+        }
42
+
31 43
         return (
32 44
             <FlagGroup onDismissed = { this._onDismissed }>
33 45
                 { this._renderFlags() }
@@ -65,4 +77,21 @@ class NotificationsContainer extends AbstractNotificationsContainer<Props> {
65 77
     }
66 78
 }
67 79
 
80
+/**
81
+ * Maps (parts of) the Redux state to the associated props for this component.
82
+ *
83
+ * @param {Object} state - The Redux state.
84
+ * @private
85
+ * @returns {Props}
86
+ */
87
+function _mapStateToProps(state) {
88
+    const { iAmSipGateway } = state['features/base/config'];
89
+
90
+    return {
91
+        ..._abstractMapStateToProps(state),
92
+        _iAmSipGateway: Boolean(iAmSipGateway)
93
+    };
94
+}
95
+
96
+
68 97
 export default connect(_mapStateToProps)(NotificationsContainer);

Loading…
取消
儲存