react-peer-chat 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +6 -2
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -47,6 +47,10 @@ export default function Chat({ name, peerId, remotePeerId = [], peerOptions, tex
47
47
  });
48
48
  conn.on('close', conn.removeAllListeners);
49
49
  }
50
+ function handleError() {
51
+ setAudio(false);
52
+ onMicError();
53
+ }
50
54
  useEffect(() => {
51
55
  if (!text && !audio) {
52
56
  setPeer(undefined);
@@ -93,10 +97,10 @@ export default function Chat({ name, peerId, remotePeerId = [], peerOptions, tex
93
97
  call.on('close', call.removeAllListeners);
94
98
  calls[call.peer] = call;
95
99
  });
96
- }, onMicError);
100
+ }, handleError);
97
101
  }
98
102
  catch (_a) {
99
- onMicError();
103
+ handleError();
100
104
  }
101
105
  }
102
106
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-peer-chat",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "An easy to use react component for impleting peer-to-peer chatting.",
5
5
  "main": "./build/index.js",
6
6
  "type": "module",