diff --git a/src/components/EditGameForm.js b/src/components/EditGameForm.js index da85c6dd00d93a634bebb935d5eee31748260352..c0fc662e0442d42c9a4ac6df49ef3b9fc943bc6b 100644 --- a/src/components/EditGameForm.js +++ b/src/components/EditGameForm.js @@ -532,6 +532,7 @@ export default class EditGameForm extends React.Component { minLength="3" onChange={this.handleChange} placeholder="Faction password" + type="password" form="factionAddFrom" /> <div diff --git a/src/components/GameView.js b/src/components/GameView.js index f92586e94bc5b379b47914ab6bf0a3954fe7c28e..6e23a635bf75c6ef21a01d62fd0c3a5522c17e7c 100644 --- a/src/components/GameView.js +++ b/src/components/GameView.js @@ -29,22 +29,19 @@ export default class GameView extends React.Component { .then(res => { if (!res.ok) { throw Error(); + } else { + return res.json(); } }) - .catch(error => { - alert("Game not found"); - window.document.location.href = "/"; - }); - - // Get game info - fetch(`${process.env.REACT_APP_API_URL}/game/${gameId}`) - .then(res => res.json()) .then(res => { this.setState({ gameInfo: res }); }) - .catch(error => console.log(error)); + .catch(error => { + alert("Game not found"); + window.document.location.href = "/"; + }); // Get Role fetch(`${process.env.REACT_APP_API_URL}/faction/check-faction/${gameId}`, { diff --git a/src/components/JoinGameForm.js b/src/components/JoinGameForm.js index f4f89edcacf82bbe4281dc5b419f694de0689eb6..038bbae9999b5a6a9ab4813d5628a1fbc13e9078 100644 --- a/src/components/JoinGameForm.js +++ b/src/components/JoinGameForm.js @@ -117,6 +117,7 @@ export default class JoinGameForm extends React.Component { onChange={e => this.setState({ factionPasswordInput: e.target.value }) } + type="password" placeholder="Password" minLength="3" required