Skip to content

Commit

Permalink
feat(sidebar): disable video button outside of call
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoodland authored and stavares843 committed May 30, 2022
1 parent ac488a0 commit 493f0b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/views/navigation/sidebar/controls/Controls.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:text="$t('controls.video')"
:action="() => toggleMute('video')"
:loading="isLoading"
:disabled="!inCall"
loadingText=""
>
<video-off-icon v-if="videoMuted" size="1x"></video-off-icon>
Expand Down
7 changes: 5 additions & 2 deletions components/views/navigation/sidebar/controls/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ export default Vue.extend({
return this.audio.muted
},
videoMuted(): boolean {
return this.video.disabled
return this.inCall ? this.video.disabled : false
},
screenMuted(): boolean {
return p2p.id && this.webrtc.streamMuted[p2p.id]?.screen
},
inCall(): boolean {
return this.webrtc.activeCall !== undefined
},
},
methods: {
/**
Expand All @@ -53,7 +56,7 @@ export default Vue.extend({
this.isLoading = true
if (kind === 'audio') {
this.$store.dispatch('audio/toggleMute', undefined, { root: true })
} else if (kind === 'video') {
} else if (kind === 'video' && this.inCall) {
this.$store.dispatch('video/toggleMute', undefined, { root: true })
}
this.isLoading = false
Expand Down

0 comments on commit 493f0b4

Please sign in to comment.