Skip to content

Commit

Permalink
Add saveUsername function to
Browse files Browse the repository at this point in the history
usePersistentUserChoices hook
  • Loading branch information
Ocupe committed Nov 7, 2023
1 parent 66df197 commit 5a45ee8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/hooks/usePersistentUserChoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export function usePersistentUserChoices(options: UsePersistentUserChoicesOption
const saveVideoInputDeviceId = React.useCallback((deviceId: string) => {
setSettings((prev) => ({ ...prev, videoInputDeviceId: deviceId }));
}, []);
const saveUsername = React.useCallback((username: string) => {
setSettings((prev) => ({ ...prev, username: username }));
}, []);

React.useEffect(() => {
saveUserChoices(userChoices, options.preventSave ?? false);
Expand All @@ -56,5 +59,6 @@ export function usePersistentUserChoices(options: UsePersistentUserChoicesOption
saveVideoInputEnabled,
saveAudioInputDeviceId,
saveVideoInputDeviceId,
saveUsername,
};
}

0 comments on commit 5a45ee8

Please sign in to comment.