fix private toggle

This commit is contained in:
Alberto Xamin 2020-12-08 23:31:55 +01:00
parent da26eae24c
commit 929024a717
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -91,6 +91,7 @@ export default {
this.lobbyName = data.name this.lobbyName = data.name
this.started = data.started this.started = data.started
this.password = data.password this.password = data.password
this.privateRoom = data.password !== ''
this.useDodgeCity = data.expansions.indexOf('dodge_city') !== -1 this.useDodgeCity = data.expansions.indexOf('dodge_city') !== -1
this.players = data.players.map(x => { this.players = data.players.map(x => {
return { return {
@ -221,8 +222,9 @@ export default {
}, },
}, },
watch: { watch: {
privateRoom() { privateRoom(old, _new) {
this.$socket.emit('private') if (this.isRoomOwner && old !== _new)
this.$socket.emit('private')
} }
}, },
mounted() { mounted() {