diff --git a/client/src/App.js b/client/src/App.js index 5ac357e..cab09b2 100755 --- a/client/src/App.js +++ b/client/src/App.js @@ -13,7 +13,6 @@ import { GlobalContext } from "./GlobalContext.js"; //import { PingPong } from "./PingPong.js"; import { PlayerList } from "./PlayerList.js"; import { Chat } from "./Chat.js"; -import { MediaAgent } from "./MediaControl.js"; import { Board } from "./Board.js"; import { Actions } from "./Actions.js"; import { base, gamesPath } from './Common.js'; @@ -40,7 +39,6 @@ const Table = () => { const [ name, setName ] = useState(""); const [ error, setError ] = useState(undefined); const [ warning, setWarning ] = useState(undefined); - const [ peers, setPeers ] = useState({}); const [loaded, setLoaded] = useState(false); const [state, setState] = useState(undefined); @@ -49,14 +47,10 @@ const Table = () => { const [buildActive, setBuildActive] = useState(false); const [cardActive, setCardActive] = useState(undefined); const [winnerDismissed, setWinnerDismissed] = useState(undefined); - const [global, setGlobal] = useState({ setPeers }); + const [global, setGlobal] = useState({}); const [count, setCount] = useState(0); const fields = [ 'id', 'state', 'color', 'name', 'private' ]; - useEffect(() => { - console.log(`app - media-agent - peers`, peers); - }, [peers]); - const onWsOpen = (event) => { console.log(`ws: open`); setError(""); @@ -163,14 +157,12 @@ const Table = () => { if (global.ws !== connection || global.name !== name - || global.gameId !== gameId - || global.peers !== peers) { + || global.gameId !== gameId) { console.log(`board - (app) - setting global`, global, - {connection, name, gameId, peers}); + {connection, name, gameId}); setGlobal({ ws: connection, - name, gameId, peers, - setPeers + name, gameId }); } @@ -313,7 +305,6 @@ const Table = () => { console.log(`board - (app) - Render with ws: ${ws ? '!' : ''}NULL, connection: ${connection ? '!' : ''}NULL`); return - { /* */ }
diff --git a/client/src/MediaControl.js b/client/src/MediaControl.js index 0b7efcf..8dfaa5f 100644 --- a/client/src/MediaControl.js +++ b/client/src/MediaControl.js @@ -20,13 +20,13 @@ const Video = ({ srcObject, local, ...props }) => { return; } const ref = refVideo.current; - if (debug) console.log('