Fix permissions in call
Change flow to ask permissions as soon as the user is in the call page
Change-Id: I1fb140ab17602bd0584714cbddb177b24a9eed01
diff --git a/client/src/contexts/CallProvider.tsx b/client/src/contexts/CallProvider.tsx
index 6b8d4ee..93ec5b5 100644
--- a/client/src/contexts/CallProvider.tsx
+++ b/client/src/contexts/CallProvider.tsx
@@ -114,10 +114,6 @@
const contactUri = useMemo(() => conversation.getFirstMember().contact.getUri(), [conversation]);
useEffect(() => {
- if (!isConnected) {
- return;
- }
-
try {
// TODO: Wait until status is `InCall` before getting devices
navigator.mediaDevices.enumerateDevices().then((devices) => {
@@ -154,7 +150,7 @@
// TODO: Better handle user denial
console.error('Could not get media devices:', e);
}
- }, [isConnected]);
+ }, []);
useEffect(() => {
if (localStream && webRtcConnection) {