diff --git a/src/components/GameView.js b/src/components/GameView.js index 6e23a635bf75c6ef21a01d62fd0c3a5522c17e7c..7a2c4b05e29a527705e5920f409abd7d4808538b 100644 --- a/src/components/GameView.js +++ b/src/components/GameView.js @@ -175,6 +175,7 @@ export default class GameView extends React.Component { mapUrl={this.state.mapUrl} currentGameId={this.state.gameInfo.id} socketSignal={this.state.socketSignal} + role={this.state.role} /> {this.state.form === "edit" && ( <EditGameForm diff --git a/src/components/Socket.js b/src/components/Socket.js index 06cc2fd899f90ce897e5bbecdd598410aca02cb1..8256585f5df46e07970c64e774e79c586c3522cb 100644 --- a/src/components/Socket.js +++ b/src/components/Socket.js @@ -47,7 +47,6 @@ export default class ClientSocket extends React.Component { // set the socket to listen gameId-thread socket.on(this.props.gameId, data => { - console.log(data); this.props.getSocketSignal(data.type); // check socket update type this.setState({ update: data.type }); diff --git a/src/components/UserMap.js b/src/components/UserMap.js index c5347fa78df07b4092296702fae1e70ee1704f8f..e9b2b26252fc313e0d5b171d7c36bf71e684ebf8 100644 --- a/src/components/UserMap.js +++ b/src/components/UserMap.js @@ -162,12 +162,15 @@ class UserMap extends Component { url={this.props.mapUrl} /> <ZoomControl position="topright" /> - <DrawTools - position={this.props.position} - sendGeoJSON={this.sendGeoJSON} - geoJSONLayer={this.state.geoJSONLayer} - currentGameId={this.props.currentGameId} - /> + {(this.props.role === "admin" || + this.props.role === "factionleader") && ( + <DrawTools + position={this.props.position} + sendGeoJSON={this.sendGeoJSON} + geoJSONLayer={this.state.geoJSONLayer} + currentGameId={this.props.currentGameId} + /> + )} {this.state.ownLat !== null && ( <Marker position={[this.state.ownLat, this.state.ownLng]}> <Popup>