From f3437373f5a6d8e660b05f981ab26782587874e6 Mon Sep 17 00:00:00 2001 From: ocupe Date: Mon, 6 Nov 2023 11:07:59 +0100 Subject: [PATCH] rename fallbackValues to defaults --- packages/react/src/hooks/usePersistentDeviceSettings.ts | 6 +++--- packages/react/src/prefabs/PreJoin.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/hooks/usePersistentDeviceSettings.ts b/packages/react/src/hooks/usePersistentDeviceSettings.ts index c82489453..3d4796cc6 100644 --- a/packages/react/src/hooks/usePersistentDeviceSettings.ts +++ b/packages/react/src/hooks/usePersistentDeviceSettings.ts @@ -8,9 +8,9 @@ import * as React from 'react'; */ interface UsePersistentDeviceSettingsOptions { /** - * The fallback value to use if no stored value is found. + * The default value to use if reading from local storage returns no results or fails. */ - fallbackValues?: DeviceSettings; + defaults?: DeviceSettings; /** * Whether to prevent saving the device settings to local storage. * @defaultValue false @@ -26,7 +26,7 @@ interface UsePersistentDeviceSettingsOptions { */ export function usePersistentDeviceSettings(options: UsePersistentDeviceSettingsOptions = {}) { const [deviceSettings, setSettings] = React.useState( - getDeviceSettings(options.fallbackValues), + getDeviceSettings(options.defaults), ); const saveAudioInputEnabled = React.useCallback((isEnabled: boolean) => { diff --git a/packages/react/src/prefabs/PreJoin.tsx b/packages/react/src/prefabs/PreJoin.tsx index ec977e445..0a7ff5a3b 100644 --- a/packages/react/src/prefabs/PreJoin.tsx +++ b/packages/react/src/prefabs/PreJoin.tsx @@ -245,7 +245,7 @@ export function PreJoin({ saveVideoInputDeviceId, saveVideoInputEnabled, } = usePersistentDeviceSettings({ - fallbackValues: { + defaults: { audioInputDeviceId: DEFAULT_USER_CHOICES.audioDeviceId, videoInputDeviceId: DEFAULT_USER_CHOICES.videoDeviceId, audioInputEnabled: DEFAULT_USER_CHOICES.audioEnabled,