0
0
Fork 0

Fix bug that allowed people to start games when cancelling the name entry.

This commit is contained in:
Oliver-Akins 2021-01-02 18:37:05 -07:00
parent 14cda8a50f
commit 34e1a19a64

View file

@ -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