Skip to content

Commit

Permalink
applying device preferences may fail
Browse files Browse the repository at this point in the history
  • Loading branch information
myandrienko committed Nov 27, 2024
1 parent c238dd8 commit f8d6359
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/react-sdk/src/hooks/usePersistedDevicePreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,22 @@ const useApplyDevicePreferences = (
console.warn('Failed to load device preferences', err);
}
if (preferences) {
await initMic(preferences.mic);
await initCamera(preferences.camera);
await initMic(preferences.mic).catch((err) => {
console.warn('Failed to apply microphone preferences', err);
});
await initCamera(preferences.camera).catch((err) => {
console.warn('Failed to apply camera preferences', err);
});
initSpeaker(preferences.speaker);
}
};

onWillApplyRef.current();
apply()
.then(() => onAppliedRef.current())
.catch((err) => {
console.warn('Failed to apply device preferences', err);
});
})
.then(() => onAppliedRef.current());

return () => {
cancel = true;
Expand Down

0 comments on commit f8d6359

Please sign in to comment.