routing improvements

This commit is contained in:
Alberto Xamin 2020-12-19 19:31:59 +01:00
parent 374e7828cc
commit b2ba24906e
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
2 changed files with 5 additions and 2 deletions

View File

@ -39,7 +39,10 @@ export default {
},
room(data) {
this.isInLobby = true;
this.$router.push({path:'game', query: { code: data.name, pwd: data.password }})
if (data.password)
this.$router.replace({path:'game', query: { code: data.name, pwd: data.password }})
else
this.$router.replace({path:'game', query: { code: data.name }})
},
},
methods: {

View File

@ -137,7 +137,7 @@ export default {
},
computed: {
inviteLink() {
return `${window.location.origin}/game?code=${this.lobbyName}&pwd=${this.password}`
return `${window.location.origin}/game?code=${this.lobbyName}${this.password?`&pwd=${this.password}`:''}`
},
expansionsStatus() {
return this.togglable_expansions.map(x=>{