react-peer-chat 0.2.3 → 0.2.4
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.
- package/build/index.js +3 -3
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import useStorage, { removeStorage } from './storage';
|
|
3
|
-
import { BiSolidMessageDetail, BiSolidMessageX, BsFillMicFill, BsFillMicMuteFill, GrSend } from './icons';
|
|
2
|
+
import useStorage, { removeStorage } from './storage.js';
|
|
3
|
+
import { BiSolidMessageDetail, BiSolidMessageX, BsFillMicFill, BsFillMicMuteFill, GrSend } from './icons.js';
|
|
4
4
|
export default function Chat({ name, peerId, remotePeerId, peerOptions, text = true, voice = true, dialogOptions, onError = () => console.error("Can not access microphone!"), children, ...props }) {
|
|
5
5
|
const [peer, setPeer] = useState();
|
|
6
6
|
const [opponentName, setOpponentName] = useState();
|
|
@@ -48,7 +48,7 @@ export default function Chat({ name, peerId, remotePeerId, peerOptions, text = t
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
(async function loadPeer() {
|
|
51
|
-
const Peer =
|
|
51
|
+
const { Peer } = await import('peerjs');
|
|
52
52
|
const peer = new Peer(`rpc-${peerId}`, peerOptions);
|
|
53
53
|
setPeer(peer);
|
|
54
54
|
})();
|