From 7416860b195d036c2369595b773c64abc85bca1f Mon Sep 17 00:00:00 2001 From: ocupe Date: Mon, 6 Nov 2023 13:22:06 +0100 Subject: [PATCH] Update ControlBar and PreJoin props --- packages/react/etc/components-react.api.md | 12 +++++++----- packages/react/src/prefabs/ControlBar.tsx | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/react/etc/components-react.api.md b/packages/react/etc/components-react.api.md index 03ac79027..651c5e0f0 100644 --- a/packages/react/etc/components-react.api.md +++ b/packages/react/etc/components-react.api.md @@ -183,7 +183,7 @@ export interface ConnectionStatusProps extends React_2.HTMLAttributes { // (undocumented) controls?: ControlBarControls; - saveDeviceSettings?: boolean; + // @alpha + saveUserChoices?: boolean; // (undocumented) variation?: 'minimal' | 'verbose' | 'textOnly'; } @@ -426,7 +427,7 @@ export interface ParticipantTileProps extends React_2.HTMLAttributes, 'onSubmit' | 'onError'> { @@ -442,7 +443,8 @@ export interface PreJoinProps extends Omit void; onSubmit?: (values: LocalUserChoices) => void; onValidate?: (values: LocalUserChoices) => boolean; - saveDeviceSettings?: boolean; + // @alpha + persistUserChoices?: boolean; // (undocumented) showE2EEOptions?: boolean; // (undocumented) @@ -830,7 +832,7 @@ export interface UseParticipantTileProps extends React_2. // @alpha export function usePersistentUserChoices(options?: UsePersistentUserChoicesOptions): { - deviceSettings: UserChoices; + userChoices: UserChoices; saveAudioInputEnabled: (isEnabled: boolean) => void; saveVideoInputEnabled: (isEnabled: boolean) => void; saveAudioInputDeviceId: (deviceId: string) => void; diff --git a/packages/react/src/prefabs/ControlBar.tsx b/packages/react/src/prefabs/ControlBar.tsx index 5ca8a639e..2d275a088 100644 --- a/packages/react/src/prefabs/ControlBar.tsx +++ b/packages/react/src/prefabs/ControlBar.tsx @@ -29,6 +29,7 @@ export interface ControlBarProps extends React.HTMLAttributes { * If `true`, the user's device choices will be persisted. * This will enables the user to have the same device choices when they rejoin the room. * @defaultValue true + * @alpha */ saveUserChoices?: boolean; } @@ -52,7 +53,7 @@ export interface ControlBarProps extends React.HTMLAttributes { export function ControlBar({ variation, controls, - saveUserChoices: saveDeviceSettings = true, + saveUserChoices = true, ...props }: ControlBarProps) { const [isChatOpen, setIsChatOpen] = React.useState(false); @@ -107,7 +108,7 @@ export function ControlBar({ saveVideoInputEnabled, saveAudioInputDeviceId, saveVideoInputDeviceId, - } = usePersistentUserChoices({ preventSave: !saveDeviceSettings }); + } = usePersistentUserChoices({ preventSave: !saveUserChoices }); return (