Kaynağa Gözat

feat(flags) add feature flag for audio-only button

master
trippledave 4 yıl önce
ebeveyn
işleme
68c2c9be40
No account linked to committer's email address

+ 6
- 0
react/features/base/flags/constants.js Dosyayı Görüntüle

@@ -19,6 +19,12 @@ export const AUDIO_FOCUS_DISABLED = 'audio-focus.disabled';
19 19
  */
20 20
 export const AUDIO_MUTE_BUTTON_ENABLED = 'audio-mute.enabled';
21 21
 
22
+/**
23
+ * Flag indicating that the Audio only button in the overflow menu is enabled.
24
+ * Default: enabled (true).
25
+ */
26
+export const AUDIO_ONLY_BUTTON_ENABLED = 'audio-only.enabled';
27
+
22 28
 /**
23 29
  * Flag indicating if calendar integration should be enabled.
24 30
  * Default: enabled (true) on Android, auto-detected on iOS.

+ 7
- 2
react/features/toolbox/components/native/AudioOnlyButton.js Dosyayı Görüntüle

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { toggleAudioOnly } from '../../../base/audio-only';
4
+import { AUDIO_ONLY_BUTTON_ENABLED, getFeatureFlag } from '../../../base/flags';
4 5
 import { translate } from '../../../base/i18n';
5 6
 import { IconAudioOnly, IconAudioOnlyOff } from '../../../base/icons';
6 7
 import { connect } from '../../../base/redux';
@@ -60,16 +61,20 @@ class AudioOnlyButton extends AbstractButton<Props, *> {
60 61
  * {@code AudioOnlyButton} component.
61 62
  *
62 63
  * @param {Object} state - The Redux state.
64
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
63 65
  * @private
64 66
  * @returns {{
65 67
  *     _audioOnly: boolean
66 68
  * }}
67 69
  */
68
-function _mapStateToProps(state): Object {
70
+function _mapStateToProps(state, ownProps): Object {
69 71
     const { enabled: audioOnly } = state['features/base/audio-only'];
72
+    const enabledInFeatureFlags = getFeatureFlag(state, AUDIO_ONLY_BUTTON_ENABLED, true);
73
+    const { visible = enabledInFeatureFlags } = ownProps;
70 74
 
71 75
     return {
72
-        _audioOnly: Boolean(audioOnly)
76
+        _audioOnly: Boolean(audioOnly),
77
+        visible
73 78
     };
74 79
 }
75 80
 

Loading…
İptal
Kaydet