diff --git a/src/component/main.vue b/src/component/main.vue index 400f0b7e..45a5a77b 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -281,19 +281,9 @@ this.websocket.on('disconnected', () => { Vue.set(this.state.connection, 'websocket', 'disconnected') this.events.emit('internal.websocket', 'disconnected') - this.webrtc.disconnect() - // TODO: reset state - Vue.set(this.state, 'member', { - id: null, - name: null, - is_admin: false, - is_watching: false, - is_controlling: false, - can_watch: false, - can_control: false, - clipboard_access: false, - }) + this.webrtc.disconnect() + this.clearState() }) // webrtc @@ -370,5 +360,15 @@ this._container.style.marginLeft = `0px` } } + + clearState() { + Vue.set(this.state.control, 'clipboard', null) + Vue.set(this.state.control, 'host_id', null) + Vue.set(this.state.control, 'implicit_hosting', false) + Vue.set(this.state.screen, 'size', { width: 1280, height: 720, rate: 30 }) + Vue.set(this.state.screen, 'configurations', []) + Vue.set(this.state, 'member_id', null) + Vue.set(this.state, 'members', {}) + } }