From baffa8dde4671e204b2e3500d1bf64fa0c21e80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 31 Jan 2021 14:47:12 +0100 Subject: [PATCH] removed unused connection state props. --- src/component/main.vue | 12 +++--------- src/component/types/state.ts | 3 --- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/component/main.vue b/src/component/main.vue index 46a9f258..1f8d69eb 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -87,9 +87,6 @@ websocket: this.websocket.supported ? 'disconnected' : 'unavailable', webrtc: this.webrtc.supported ? 'disconnected' : 'unavailable', type: 'none', - can_watch: false, - can_control: false, - clipboard_access: false, }, video: { playable: false, @@ -365,10 +362,12 @@ }) this.webrtc.on('connected', () => { Vue.set(this.state.connection, 'webrtc', 'connected') + Vue.set(this.state.connection, 'type', 'webrtc') this.events.emit('connection.webrtc', 'connected') }) this.webrtc.on('disconnected', () => { Vue.set(this.state.connection, 'webrtc', 'disconnected') + Vue.set(this.state.connection, 'type', 'none') this.events.emit('connection.webrtc', 'disconnected') if (!this._video) return @@ -382,11 +381,6 @@ } }) - // hardcoded webrtc for now - Vue.set(this.state.connection, 'type', 'webrtc') - Vue.set(this.state.connection, 'can_watch', this.webrtc.supported) - Vue.set(this.state.connection, 'can_control', this.webrtc.supported) - // check if is user logged in this.api.session.whoami().then(() => { Vue.set(this.state.connection, 'authenticated', true) @@ -395,7 +389,7 @@ // unmute on users first interaction if (this.autoplay) { - document.addEventListener('click', this.unmute, { once: true }) + document.addEventListener('click', () => this.unmute(), { once: true }) } } diff --git a/src/component/types/state.ts b/src/component/types/state.ts index 06ec0175..3cdf29ac 100644 --- a/src/component/types/state.ts +++ b/src/component/types/state.ts @@ -15,9 +15,6 @@ export interface Connection { websocket: 'unavailable' | 'disconnected' | 'connecting' | 'connected' webrtc: 'unavailable' | 'disconnected' | 'connecting' | 'connected' type: 'webrtc' | 'fallback' | 'none' - can_watch: boolean - can_control: boolean - clipboard_access: boolean } /////////////////////////////