Skip to content
Snippets Groups Projects
Commit 4747ef74 authored by Joni Laukka's avatar Joni Laukka
Browse files

Only admin and factionleader can now see map drawing tools

parent 8e12ebd6
No related branches found
No related tags found
2 merge requests!46Development to testing,!36Hide drawing tools
......@@ -178,6 +178,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
......
......@@ -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 });
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment