Add error when game code is empty

This commit is contained in:
Tim 2021-07-06 18:03:06 +02:00
parent 9fbdd98bc6
commit 8532c5750f

View File

@ -77,6 +77,10 @@ export default class Home extends Vue {
} }
private joinGame() { private joinGame() {
if (this.code === '') {
this.error = "Game code cannot be empty when joining a game";
return;
}
PerudoApi.instance.joinGame(this.name, this.code).then((response: JoinCreateGameObject) => { PerudoApi.instance.joinGame(this.name, this.code).then((response: JoinCreateGameObject) => {
this.playerId = response.player.id; this.playerId = response.player.id;