fixed bug where changing speaker did not stick

This commit is contained in:
Jon 2021-06-28 18:18:12 +01:00
parent ea1fac4ebc
commit ed5fe776fc
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,8 @@ export const DeviceSelect = () => {
return <div>Loading devices...</div>;
}
console.log(currentDevices);
return (
<>
<Field label="Select camera:">

View File

@ -227,7 +227,7 @@ export const useDevices = (callObject) => {
async (newSpeakers, useLocalStorage = true) => {
if (
!callObject ||
newSpeakers.deviceId === currentDevices?.speakers?.deviceId
newSpeakers.deviceId === currentDevices?.speaker?.deviceId
) {
return;
}
@ -242,7 +242,7 @@ export const useDevices = (callObject) => {
outputDeviceId: newSpeakers.deviceId,
});
setCurrentDevices((prev) => ({ ...prev, speakers: newSpeakers }));
setCurrentDevices((prev) => ({ ...prev, speaker: newSpeakers }));
},
[callObject, currentDevices]
);