Add username display for the player.

This commit is contained in:
Oliver-Akins 2020-10-05 22:53:20 -06:00
parent fc5efdc118
commit 267395efe9

View file

@ -4,6 +4,8 @@
Secret Hitler Online Secret Hitler Online
</h1> </h1>
<h2> <h2>
Username: {{ username }}
<br>
Game Code: Game Code:
<code <code
v-clipboard="copy_game_code" v-clipboard="copy_game_code"
@ -31,11 +33,13 @@ export default {
data() {return { data() {return {
game_code: ``, game_code: ``,
is_host: false, is_host: false,
username: ``,
players: [], players: [],
}}, }},
mounted() { mounted() {
this.game_code = sessionStorage.getItem(`game-code`); this.game_code = sessionStorage.getItem(`game-code`);
this.is_host = JSON.parse(sessionStorage.getItem(`is-host`)); this.is_host = JSON.parse(sessionStorage.getItem(`is-host`));
this.username = sessionStorage.getItem(`user-name`);
this.$nextTick(() => this.getPlayerList()); this.$nextTick(() => this.getPlayerList());
}, },
methods: { methods: {