Просмотр исходного кода

Fix error on conference join when calendar is disabled

master
zbettenbuk 7 лет назад
Родитель
Сommit
54b6db02d8

+ 4
- 1
react/features/calendar-sync/components/ConferenceNotification.native.js Просмотреть файл

@@ -10,6 +10,7 @@ import { Icon } from '../../base/font-icons';
10 10
 import { getLocalizedDateFormatter, translate } from '../../base/i18n';
11 11
 import { ASPECT_RATIO_NARROW } from '../../base/responsive-ui';
12 12
 
13
+import { CALENDAR_ENABLED } from '../constants';
13 14
 import styles from './styles';
14 15
 
15 16
 const ALERT_MILLISECONDS = 5 * 60 * 1000;
@@ -278,4 +279,6 @@ function _mapStateToProps(state: Object) {
278 279
     };
279 280
 }
280 281
 
281
-export default translate(connect(_mapStateToProps)(ConferenceNotification));
282
+export default CALENDAR_ENABLED
283
+    ? translate(connect(_mapStateToProps)(ConferenceNotification))
284
+    : undefined;

+ 18
- 1
react/features/conference/components/Conference.native.js Просмотреть файл

@@ -234,7 +234,9 @@ class Conference extends Component<Props> {
234 234
                 </View>
235 235
                 <TestConnectionInfo />
236 236
 
237
-                <ConferenceNotification />
237
+                {
238
+                    this._renderConferenceNotification()
239
+                }
238 240
 
239 241
                 {/*
240 242
                   * The dialogs are in the topmost stacking layers.
@@ -290,6 +292,21 @@ class Conference extends Component<Props> {
290 292
         return this._backHandler && this.props._onHardwareBackPress();
291 293
     }
292 294
 
295
+    /**
296
+     * Renders the conference notification badge if the feature is enabled.
297
+     *
298
+     * Note: If the calendar feature is disabled on a platform, then we don't
299
+     * have its components exported so an undefined check is necessary.
300
+     *
301
+     * @private
302
+     * @returns {React$Node}
303
+     */
304
+    _renderConferenceNotification() {
305
+        return ConferenceNotification
306
+            ? <ConferenceNotification />
307
+            : undefined;
308
+    }
309
+
293 310
     /**
294 311
      * Triggers the default Toolbox timeout.
295 312
      *

Загрузка…
Отмена
Сохранить