From 9f73eb76a3b6886e4ece6cc2a16945858d69fd4f Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 16 Sep 2024 12:57:01 -0500 Subject: [PATCH] fix(follow-me): Small UI fixes. Does not allow toggling both follow me and follow me recorder. And make when locally enabled show correct status when follow me recorder is selected. --- .../components/native/ModeratorSection.tsx | 16 +++++++++++++--- .../settings/components/web/ModeratorTab.tsx | 16 ++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/react/features/settings/components/native/ModeratorSection.tsx b/react/features/settings/components/native/ModeratorSection.tsx index b4fb0632ed..b1f614b0df 100644 --- a/react/features/settings/components/native/ModeratorSection.tsx +++ b/react/features/settings/components/native/ModeratorSection.tsx @@ -18,7 +18,9 @@ import FormSection from './FormSection'; const ModeratorSection = () => { const dispatch = useDispatch(); const { + followMeActive, followMeEnabled, + followMeRecorderActive, followMeRecorderEnabled, startAudioMuted, startVideoMuted, @@ -50,29 +52,36 @@ const ModeratorSection = () => { dispatch(updateSettings({ soundsReactions: enabled })); }, [ dispatch, updateSettings, setStartReactionsMuted ]); + const followMeRecorderChecked = followMeRecorderEnabled && !followMeRecorderActive; + const moderationSettings = useMemo(() => { const moderation = [ { + disabled: false, label: 'settings.startAudioMuted', state: startAudioMuted, onChange: onStartAudioMutedToggled }, { + disabled: false, label: 'settings.startVideoMuted', state: startVideoMuted, onChange: onStartVideoMutedToggled }, { + disabled: followMeActive || followMeRecorderActive, label: 'settings.followMe', - state: followMeEnabled, + state: followMeEnabled && !followMeActive && !followMeRecorderChecked, onChange: onFollowMeToggled }, { + disabled: followMeRecorderActive || followMeActive, label: 'settings.followMeRecorder', - state: followMeRecorderEnabled, + state: followMeRecorderChecked, onChange: onFollowMeRecorderToggled }, { + disabled: false, label: 'settings.startReactionsMuted', state: startReactionsMuted, onChange: onStartReactionsMutedToggled @@ -100,12 +109,13 @@ const ModeratorSection = () => { { - moderationSettings.map(({ label, state, onChange }) => ( + moderationSettings.map(({ label, state, onChange, disabled }) => ( )) diff --git a/react/features/settings/components/web/ModeratorTab.tsx b/react/features/settings/components/web/ModeratorTab.tsx index 5796d969e8..60be5b0fa2 100644 --- a/react/features/settings/components/web/ModeratorTab.tsx +++ b/react/features/settings/components/web/ModeratorTab.tsx @@ -150,7 +150,10 @@ class ModeratorTab extends AbstractDialogTab { * @returns {void} */ _onFollowMeEnabledChanged({ target: { checked } }: React.ChangeEvent) { - super._onChange({ followMeEnabled: checked }); + super._onChange({ + followMeEnabled: checked, + followMeRecorderEnabled: checked ? false : undefined + }); } /** @@ -161,7 +164,10 @@ class ModeratorTab extends AbstractDialogTab { * @returns {void} */ _onFollowMeRecorderEnabledChanged({ target: { checked } }: React.ChangeEvent) { - super._onChange({ followMeRecorderEnabled: checked }); + super._onChange({ + followMeEnabled: checked ? false : undefined, + followMeRecorderEnabled: checked + }); } /** @@ -184,6 +190,8 @@ class ModeratorTab extends AbstractDialogTab { } = this.props; const classes = withStyles.getClasses(this.props); + const followMeRecorderChecked = followMeRecorderEnabled && !followMeRecorderActive; + return (
{ name = 'start-video-muted' onChange = { this._onStartVideoMutedChanged } />