Skip to content

Commit

Permalink
feat(subtitles): Disable for guests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hristoterezov committed May 28, 2020
1 parent 8b4f178 commit 3e7abf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export class AbstractClosedCaptionButton
*/
export function _abstractMapStateToProps(state: Object, ownProps: Object) {
const { _requestingSubtitles } = state['features/subtitles'];
const { isGuest = true } = state['features/base/jwt'];
const { transcribingEnabled } = state['features/base/config'];
const { visible = Boolean(transcribingEnabled) } = ownProps;
const { visible = Boolean(transcribingEnabled && !isGuest) } = ownProps;

return {
_requestingSubtitles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class ClosedCaptionButton
*/
export function mapStateToProps(state: Object, ownProps: Object) {
const { transcribingEnabled } = state['features/base/config'];
const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true) && transcribingEnabled;
const { isGuest = true } = state['features/base/jwt'];
const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true) && transcribingEnabled && !isGuest;
const { visible = enabled } = ownProps;

return {
Expand Down

0 comments on commit 3e7abf3

Please sign in to comment.