Fix bug that allowed people to start games when cancelling the name entry.
This commit is contained in:
parent
14cda8a50f
commit
34e1a19a64
1 changed files with 6 additions and 3 deletions
|
|
@ -23,9 +23,12 @@ export default {
|
||||||
createGame() {
|
createGame() {
|
||||||
this.name = prompt(`What is your name?`);
|
this.name = prompt(`What is your name?`);
|
||||||
|
|
||||||
|
// Assert that the user entered a name and didn't cancel
|
||||||
|
if (this.name) {
|
||||||
this.$socket.client.emit(`CreateGame`, {
|
this.$socket.client.emit(`CreateGame`, {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
});
|
});
|
||||||
|
};
|
||||||
},
|
},
|
||||||
joinGame() {
|
joinGame() {
|
||||||
// Get the user's name
|
// Get the user's name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue