Disconnect from server if not in room

This commit is contained in:
samcm 2017-04-10 22:28:49 +10:00
parent 18484fbbcb
commit f6d9ffd5c1
2 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,7 @@
<!-- MODALS -->
<div v-if="darkMode">
<sweet-modal ref="joinroomModal" overlay-theme="dark" modal-theme="dark" >
<sweet-modal v-on:close="joinRoomModalClosed()" ref="joinroomModal" overlay-theme="dark" modal-theme="dark" >
<joinroom></joinroom>
</sweet-modal>
</div>
@ -313,6 +313,11 @@ export default {
return this.$refs.joinroomModal.open()
//$('#joinRoomModal').modal('open');
},
joinRoomModalClosed: function(){
if (!this.ptRoom){
this.$store.dispatch('disconnectServer')
}
},
showChat: function(){
this.showToggleChat = !this.showToggleChat
console.log('toggleChat')

View File

@ -151,7 +151,6 @@ export default {
joinRoom: function(){
var that = this
console.log('Attempting to join room ' + this.room)
console.log(this)
if (!this.context.getters.getConnected){
console.log('Cant join room because we arent connected to a server!')
return