Skip to content

Commit

Permalink
rename fallbackValues to defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocupe committed Nov 6, 2023
1 parent 9d02f97 commit f343737
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/hooks/usePersistentDeviceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +26,7 @@ interface UsePersistentDeviceSettingsOptions {
*/
export function usePersistentDeviceSettings(options: UsePersistentDeviceSettingsOptions = {}) {
const [deviceSettings, setSettings] = React.useState<DeviceSettings>(
getDeviceSettings(options.fallbackValues),
getDeviceSettings(options.defaults),
);

const saveAudioInputEnabled = React.useCallback((isEnabled: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/prefabs/PreJoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f343737

Please sign in to comment.