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
feat(settings): remember config values the user chose in the browser
Hristo Terezovf9a5f5fcf770
diff --git a/react/features/base/settings/functions.any.ts b/react/features/base/settings/functions.any.tsindex 70514f5f4d..b551bbedc8 100644--- a/react/features/base/settings/functions.any.ts+++ b/react/features/base/settings/functions.any.ts@@ -124,3 +124,20 @@ export function getHideSelfView(state: IReduxState) {return state['features/base/config'].disableSelfView || state['features/base/settings'].disableSelfView|| iAmVisitor(state);}++/**+ * Returns the value the user chose for a config option of the Experimental tab of the settings dialog, or undefined+ * when they have not chosen one. The feature owning the option decides what the choice means next to its config, see+ * e.g. {@code isBrowserPiPTurnedOn()} of the pip feature. The value comes from the browser's local storage, where an+ * older version of the option or a hand edit may have left anything, so a value of an unexpected type counts as no+ * choice.+ *+ * @param {IReduxState} state - The redux state.+ * @param {string} optionId - The id of the config option, see {@code CONFIG_OPTIONS} of the settings feature.+ * @returns {boolean|undefined} - The user's choice, if any.+ */+export function getUserSelectedConfigValue(state: IReduxState, optionId: string): boolean | undefined {+ const value = state['features/base/settings'].userSelectedConfig?.[optionId];++ return typeof value === 'boolean' ? value : undefined;+}diff --git a/react/features/base/settings/reducer.ts b/react/features/base/settings/reducer.tsindex 61efdb1416..2905f4e7df 100644--- a/react/features/base/settings/reducer.ts+++ b/react/features/base/settings/reducer.ts@@ -44,6 +44,7 @@ const DEFAULT_STATE: ISettingsState = {userSelectedMicDeviceId: undefined,userSelectedAudioOutputDeviceLabel: undefined,userSelectedCameraDeviceLabel: undefined,+ userSelectedConfig: {},userSelectedLanguage: undefined,userSelectedNotifications: {'notify.chatMessages': true@@ -90,6 +91,14 @@ export interface ISettingsState {userSelectedAudioOutputDeviceLabel?: string;userSelectedCameraDeviceId?: string;userSelectedCameraDeviceLabel?: string;++ /**+ * Config values the user has chosen, keyed by the id of the config option (see {@code CONFIG_OPTIONS} of the+ * settings feature).+ */+ userSelectedConfig?: {+ [optionId: string]: boolean;+ };userSelectedLanguage?: string;userSelectedMicDeviceId?: string;userSelectedMicDeviceLabel?: string;