Quellcode durchsuchen

notifications: hdie all (visual) notifications for SIP gateways

master
Saúl Ibarra Corretgé vor 5 Jahren
Ursprung
Commit
cdbc5976a0
1 geänderte Dateien mit 31 neuen und 2 gelöschten Zeilen
  1. 31
    2
      react/features/notifications/components/web/NotificationsContainer.js

+ 31
- 2
react/features/notifications/components/web/NotificationsContainer.js Datei anzeigen

6
 import { connect } from '../../../base/redux';
6
 import { connect } from '../../../base/redux';
7
 
7
 
8
 import AbstractNotificationsContainer, {
8
 import AbstractNotificationsContainer, {
9
-    _abstractMapStateToProps as _mapStateToProps,
10
-    type Props
9
+    _abstractMapStateToProps,
10
+    type Props as AbstractProps
11
 } from '../AbstractNotificationsContainer';
11
 } from '../AbstractNotificationsContainer';
12
 
12
 
13
 import Notification from './Notification';
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
  * Implements a React {@link Component} which displays notifications and handles
24
  * Implements a React {@link Component} which displays notifications and handles
17
  * automatic dismissmal after a notification is shown for a defined timeout
25
  * automatic dismissmal after a notification is shown for a defined timeout
28
      * @returns {ReactElement}
36
      * @returns {ReactElement}
29
      */
37
      */
30
     render() {
38
     render() {
39
+        if (this.props._iAmSipGateway) {
40
+            return null;
41
+        }
42
+
31
         return (
43
         return (
32
             <FlagGroup onDismissed = { this._onDismissed }>
44
             <FlagGroup onDismissed = { this._onDismissed }>
33
                 { this._renderFlags() }
45
                 { this._renderFlags() }
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
 export default connect(_mapStateToProps)(NotificationsContainer);
97
 export default connect(_mapStateToProps)(NotificationsContainer);

Laden…
Abbrechen
Speichern