Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(settings): save the reaction sounds and follow me toggles like they show (#18152)
moataz hjaijid0c30ef6f5c7
diff --git a/react/features/settings/actions.web.ts b/react/features/settings/actions.web.tsindex eabcac2a69..b0b7ae59d6 100644--- a/react/features/settings/actions.web.ts+++ b/react/features/settings/actions.web.ts@@ -19,7 +19,7 @@ import { updateSettings } from '../base/settings/actions';import { IAudioSettings } from '../base/settings/reducer';import { getLocalVideoTrack } from '../base/tracks/functions.web';import { appendURLHashParam } from '../base/util/uri';-import { setFollowMe, setFollowMeRecorder } from '../follow-me/actions';+import { setFollowMe, setFollowMeRecorderExclusive } from '../follow-me/actions';import {disableKeyboardShortcuts,enableKeyboardShortcuts,@@ -218,12 +218,15 @@ export function submitModeratorTab(newState: any) {return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {const currentState = getModeratorTabProps(getState());- if (newState.followMeEnabled !== currentState.followMeEnabled) {- dispatch(setFollowMe(newState.followMeEnabled));+ // The recorder mode also sets follow me, thus apply it first and compare follow me with the result.+ // Turning it on also turns off follow me first, so the followers get "off" and then the recorder command.+ if (newState.followMeRecorderEnabled !== currentState.followMeRecorderEnabled) {+ dispatch(setFollowMeRecorderExclusive(newState.followMeRecorderEnabled));}- if (newState.followMeRecorderEnabled !== currentState.followMeRecorderEnabled) {- dispatch(setFollowMeRecorder(newState.followMeRecorderEnabled));+ if (!newState.followMeRecorderEnabled+ && newState.followMeEnabled !== getModeratorTabProps(getState()).followMeEnabled) {+ dispatch(setFollowMe(newState.followMeEnabled));}if (newState.startReactionsMuted !== currentState.startReactionsMuted) {diff --git a/react/features/settings/components/native/ModeratorSection.tsx b/react/features/settings/components/native/ModeratorSection.tsxindex 463df88fa3..f44ac0c84b 100644--- a/react/features/settings/components/native/ModeratorSection.tsx+++ b/react/features/settings/components/native/ModeratorSection.tsx@@ -8,7 +8,7 @@ import {} from '../../../base/conference/actions';import { updateSettings } from '../../../base/settings/actions';import Switch from '../../../base/ui/components/native/Switch';-import { setFollowMe, setFollowMeRecorder } from '../../../follow-me/actions';+import { setFollowMe, setFollowMeRecorder, setFollowMeRecorderExclusive } from '../../../follow-me/actions';import { getModeratorTabProps } from '../../functions.native';import FormRow from './FormRow';@@ -47,16 +47,20 @@ const ModeratorSection = () => {}, [ startAudioMuted, dispatch, setStartMutedPolicy ]);const onFollowMeToggled = useCallback((enabled?: boolean) => {+ // Turning off the recorder mode also turns off follow me, thus do it first.+ if (enabled && followMeRecorderEnabled) {+ dispatch(setFollowMeRecorder(false));+ }dispatch(setFollowMe(Boolean(enabled)));- }, [ dispatch, setFollowMe ]);+ }, [ followMeRecorderEnabled, dispatch, setFollowMe, setFollowMeRecorder ]);const onFollowMeRecorderToggled = useCallback((enabled?: boolean) => {- dispatch(setFollowMeRecorder(Boolean(enabled)));- }, [ dispatch, setFollowMeRecorder ]);+ dispatch(setFollowMeRecorderExclusive(Boolean(enabled)));+ }, [ dispatch, setFollowMeRecorderExclusive ]);const onStartReactionsMutedToggled = useCallback((enabled?: boolean) => {dispatch(setStartReactionsMuted(Boolean(enabled), true));- dispatch(updateSettings({ soundsReactions: enabled }));+ dispatch(updateSettings({ soundsReactions: !enabled }));}, [ dispatch, updateSettings, setStartReactionsMuted ]);const { conference } = useSelector((state: IReduxState) => state['features/base/conference']);