Add GameKilled handler
This commit is contained in:
parent
7e2c53dfc4
commit
8d1b24b363
1 changed files with 18 additions and 1 deletions
|
|
@ -138,7 +138,24 @@ export default {
|
|||
}, 2000);
|
||||
};
|
||||
this.players = this.players.filter(x => x !== data.player);
|
||||
}
|
||||
},
|
||||
GameKilled(data) {
|
||||
if (data.success) {
|
||||
this.$emit(`alert`, {
|
||||
message: `The host cancelled the game.`,
|
||||
classes: [`info`],
|
||||
});
|
||||
this.$emit(`go-to`, `game-type`);
|
||||
} else {
|
||||
this.$emit(`alert`, {
|
||||
message: data.message,
|
||||
classes: [`warning`],
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$emit(`alert`, {message: ``, classes: []});
|
||||
}, 3000);
|
||||
};
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue