Remove the is-host event for the data and put it into sessionStorage
This commit is contained in:
parent
e9416b5dce
commit
74a784f497
2 changed files with 2 additions and 5 deletions
|
|
@ -14,7 +14,6 @@
|
||||||
/>
|
/>
|
||||||
<Join-Or-Host
|
<Join-Or-Host
|
||||||
v-else-if="state == 'game-type'"
|
v-else-if="state == 'game-type'"
|
||||||
@is-host="is_host = $event"
|
|
||||||
@go-to="state = $event"
|
@go-to="state = $event"
|
||||||
/>
|
/>
|
||||||
<Game-Code
|
<Game-Code
|
||||||
|
|
@ -65,7 +64,6 @@ export default {
|
||||||
*/
|
*/
|
||||||
state: `game-type`,
|
state: `game-type`,
|
||||||
game_code: ``,
|
game_code: ``,
|
||||||
is_host: false,
|
|
||||||
alert: {
|
alert: {
|
||||||
message: ``,
|
message: ``,
|
||||||
classes: []
|
classes: []
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,8 @@ export default {
|
||||||
HostInformation(data) {
|
HostInformation(data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
sessionStorage.setItem(`game-code`, data.game_code);
|
sessionStorage.setItem(`game-code`, data.game_code);
|
||||||
this.$emit(`is-host`, true);
|
sessionStorage.setItem(`host`, true);
|
||||||
// this.$emit(`go-to`, `lobby`);
|
this.$emit(`go-to`, `lobby`);
|
||||||
this.$store.state.state = `lobby`;
|
|
||||||
} else {
|
} else {
|
||||||
this.error = data.error_message
|
this.error = data.error_message
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue