From 3e7abf3da0c54abccfcbf53d62497b2fbb4ed8d2 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Mon, 6 Apr 2020 15:48:31 -0500 Subject: [PATCH] feat(subtitles): Disable for guests. --- .../subtitles/components/AbstractClosedCaptionButton.js | 3 ++- .../subtitles/components/ClosedCaptionButton.native.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/react/features/subtitles/components/AbstractClosedCaptionButton.js b/react/features/subtitles/components/AbstractClosedCaptionButton.js index cd197acf786d..d927746a25aa 100644 --- a/react/features/subtitles/components/AbstractClosedCaptionButton.js +++ b/react/features/subtitles/components/AbstractClosedCaptionButton.js @@ -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, diff --git a/react/features/subtitles/components/ClosedCaptionButton.native.js b/react/features/subtitles/components/ClosedCaptionButton.native.js index b0887fe22cb5..ce37ae724186 100644 --- a/react/features/subtitles/components/ClosedCaptionButton.native.js +++ b/react/features/subtitles/components/ClosedCaptionButton.native.js @@ -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 {