Temporarily remove strict mode to fix the call

Strict mode was causing an issue with the call flow. This disables it
temporarily, it will be reworked in the future.

Other changes:

- In CallProvider, ask mediadevices permission after the call is
  connected
- In WebRtcProvider, add `iceconnectionstatechange` listener to set the
  connected status

Change-Id: Ic366775c717d403faabe9c5787a26bd5c805e006
diff --git a/client/src/contexts/CallProvider.tsx b/client/src/contexts/CallProvider.tsx
index f29ad74..111d6e7 100644
--- a/client/src/contexts/CallProvider.tsx
+++ b/client/src/contexts/CallProvider.tsx
@@ -110,27 +110,30 @@
   const contactUri = useMemo(() => conversation.getFirstMember().contact.getUri(), [conversation]);
 
   useEffect(() => {
-    // TODO: Wait until status is `InCall` before getting devices
-    navigator.mediaDevices.enumerateDevices().then((devices) => {
-      const newMediaDevices: Record<MediaDeviceKind, MediaDeviceInfo[]> = {
-        audioinput: [],
-        audiooutput: [],
-        videoinput: [],
-      };
+    if (!isConnected) {
+      return;
+    }
 
-      for (const device of devices) {
-        newMediaDevices[device.kind].push(device);
-      }
-
-      setMediaDevices(newMediaDevices);
-    });
-  }, []);
-
-  useEffect(() => {
-    // TODO: Only ask media permission once the call has been accepted
     try {
-      // TODO: When toggling mute on/off, the camera flickers
-      // https://git.jami.net/savoirfairelinux/jami-web/-/issues/90
+      // TODO: Wait until status is `InCall` before getting devices
+      navigator.mediaDevices.enumerateDevices().then((devices) => {
+        const newMediaDevices: Record<MediaDeviceKind, MediaDeviceInfo[]> = {
+          audioinput: [],
+          audiooutput: [],
+          videoinput: [],
+        };
+
+        for (const device of devices) {
+          newMediaDevices[device.kind].push(device);
+        }
+
+        setMediaDevices(newMediaDevices);
+      });
+    } catch (e) {
+      console.error('Could not get media devices:', e);
+    }
+
+    try {
       navigator.mediaDevices
         .getUserMedia({
           audio: true, // TODO: Set both to false by default
@@ -147,7 +150,7 @@
       // TODO: Better handle user denial
       console.error('Could not get media devices:', e);
     }
-  }, [setLocalStream]);
+  }, [isConnected]);
 
   useEffect(() => {
     if (localStream && webRtcConnection) {