diff --git a/react/features/prejoin/actionTypes.js b/react/features/prejoin/actionTypes.js index aa529358c..2ad5b23af 100644 --- a/react/features/prejoin/actionTypes.js +++ b/react/features/prejoin/actionTypes.js @@ -15,9 +15,9 @@ export const PREJOIN_INITIALIZED = 'PREJOIN_INITIALIZED'; export const SET_DEVICE_STATUS = 'SET_DEVICE_STATUS'; /** - * Action type to set the visibility of the prejoin page for the future. + * Action type to mark the fact that the 'skip prejoin' option was modified this session. */ -export const SET_SKIP_PREJOIN = 'SET_SKIP_PREJOIN'; +export const SET_SKIP_PREJOIN_CHANGING = 'SET_SKIP_PREJOIN_CHANGING'; /** * Action type to set the visibility of the prejoin page when client is forcefully reloaded. diff --git a/react/features/prejoin/actions.js b/react/features/prejoin/actions.js index 28149f422..74deadca4 100644 --- a/react/features/prejoin/actions.js +++ b/react/features/prejoin/actions.js @@ -8,7 +8,6 @@ import { v4 as uuidv4 } from 'uuid'; import { getDialOutStatusUrl, getDialOutUrl, updateConfig } from '../base/config'; import { browser, createLocalTrack } from '../base/lib-jitsi-meet'; import { isVideoMutedByUser, MEDIA_TYPE } from '../base/media'; -import { updateSettings } from '../base/settings'; import { createLocalTracksF, getLocalAudioTrack, @@ -28,7 +27,7 @@ import { SET_DIALOUT_NUMBER, SET_DIALOUT_STATUS, SET_PREJOIN_DISPLAY_NAME_REQUIRED, - SET_SKIP_PREJOIN, + SET_SKIP_PREJOIN_CHANGING, SET_SKIP_PREJOIN_RELOAD, SET_JOIN_BY_PHONE_DIALOG_VISIBLITY, SET_PRECALL_TEST_RESULTS, @@ -228,15 +227,10 @@ export function joinConference(options?: Object, ignoreJoiningInProgress: boolea } const state = getState(); - const { userSelectedSkipPrejoin } = state['features/prejoin']; let localTracks = getLocalTracks(state['features/base/tracks']); options && dispatch(updateConfig(options)); - userSelectedSkipPrejoin && dispatch(updateSettings({ - userSelectedSkipPrejoin - })); - // Do not signal audio/video tracks if the user joins muted. for (const track of localTracks) { // Always add the audio track on Safari because of a known issue where audio playout doesn't happen @@ -484,14 +478,15 @@ export function setDialOutNumber(value: string) { } /** - * Sets the visibility of the prejoin page for future uses. + * Sets a flag which signals that the option to skip the prejoin + * page on join has been modified during this session. * * @param {boolean} value - The visibility value. * @returns {Object} */ -export function setSkipPrejoin(value: boolean) { +export function setSkipPrejoinIsChanging(value: boolean) { return { - type: SET_SKIP_PREJOIN, + type: SET_SKIP_PREJOIN_CHANGING, value }; } diff --git a/react/features/prejoin/functions.js b/react/features/prejoin/functions.js index 94dc74abf..b306700dd 100644 --- a/react/features/prejoin/functions.js +++ b/react/features/prejoin/functions.js @@ -36,16 +36,6 @@ export function isDisplayNameRequired(state: Object): boolean { || state['features/base/config'].requireDisplayName; } -/** - * Selector for determining if the user has chosen to skip prejoin page. - * - * @param {Object} state - The state of the app. - * @returns {boolean} - */ -export function isPrejoinSkipped(state: Object) { - return state['features/prejoin'].userSelectedSkipPrejoin; -} - /** * Returns the text for the prejoin status bar. * @@ -160,6 +150,12 @@ export function isPrejoinPageEnabled(state: Object): boolean { * @returns {boolean} */ export function isPrejoinPageVisible(state: Object): boolean { + // If the user has changed the setting for prejoin visibility on start + // let the visibility be controlled only by the 'showPrejoin' flag. + if (state['features/prejoin'].skipPrejoinChanging) { + return state['features/prejoin']?.showPrejoin; + } + return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin; } diff --git a/react/features/prejoin/reducer.js b/react/features/prejoin/reducer.js index c8891d166..dbb63d6a2 100644 --- a/react/features/prejoin/reducer.js +++ b/react/features/prejoin/reducer.js @@ -11,7 +11,7 @@ import { SET_PREJOIN_DEVICE_ERRORS, SET_PREJOIN_DISPLAY_NAME_REQUIRED, SET_PREJOIN_PAGE_VISIBILITY, - SET_SKIP_PREJOIN, + SET_SKIP_PREJOIN_CHANGING, SET_SKIP_PREJOIN_RELOAD } from './actionTypes'; @@ -30,9 +30,9 @@ const DEFAULT_STATE = { name: '', rawError: '', showPrejoin: true, + skipPrejoinChanging: false, skipPrejoinOnReload: false, - showJoinByPhoneDialog: false, - userSelectedSkipPrejoin: false + showJoinByPhoneDialog: false }; /** @@ -59,10 +59,10 @@ ReducerRegistry.register( ...state, joiningInProgress: action.value }; - case SET_SKIP_PREJOIN: { + case SET_SKIP_PREJOIN_CHANGING: { return { ...state, - userSelectedSkipPrejoin: action.value + skipPrejoinChanging: action.value }; } diff --git a/react/features/settings/actions.js b/react/features/settings/actions.js index 2ce91e2ec..d644afac4 100644 --- a/react/features/settings/actions.js +++ b/react/features/settings/actions.js @@ -11,7 +11,7 @@ import { openDialog } from '../base/dialog'; import { i18next } from '../base/i18n'; import { updateSettings } from '../base/settings'; import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../notifications'; -import { setPrejoinPageVisibility } from '../prejoin/actions'; +import { setPrejoinPageVisibility, setSkipPrejoinIsChanging } from '../prejoin/actions'; import { setScreenshareFramerate } from '../screen-share/actions'; import { @@ -96,9 +96,12 @@ export function submitMoreTab(newState: Object): Function { if (showPrejoinPage && getState()['features/prejoin']?.showPrejoin) { dispatch(setPrejoinPageVisibility(false)); } - dispatch(updateSettings({ - userSelectedSkipPrejoin: !showPrejoinPage - })); + batch(() => { + dispatch(setSkipPrejoinIsChanging(true)); + dispatch(updateSettings({ + userSelectedSkipPrejoin: !showPrejoinPage + })); + }); } if (newState.currentLanguage !== currentState.currentLanguage) {