|
|
@@ -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
|
|