Skip to content

Commit

Permalink
fix(toggleMute): fix rebase mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg committed Jun 3, 2022
1 parent 8dec647 commit 7911415
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 8 additions & 3 deletions components/views/media/actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { mapState } from 'vuex'
import { WebRTCEnum } from '~/libraries/Enums/enums'
import { Peer2Peer } from '~/libraries/WebRTC/Libp2p'
import { RootState } from '~/types/store/store'
const p2p = Peer2Peer.getInstance()
export default Vue.extend({
Expand All @@ -34,7 +35,11 @@ export default Vue.extend({
}
},
computed: {
...mapState(['audio', 'video', 'webrtc']),
...mapState({
audio: (state) => (state as RootState).audio,
video: (state) => (state as RootState).video,
webrtc: (state) => (state as RootState).webrtc,
}),
audioMuted(): boolean {
return this.audio.muted
},
Expand All @@ -51,15 +56,15 @@ export default Vue.extend({
* @description Toggles mute for outgoing audio
* @example
*/
async toggleMute(kind: WebRTCEnum) {
toggleMute(kind: WebRTCEnum) {
this.isLoading = true
try {
if (kind === WebRTCEnum.AUDIO) {
this.$store.dispatch('audio/toggleMute', undefined, { root: true })
} else if (kind === WebRTCEnum.VIDEO) {
this.$store.dispatch('video/toggleMute', undefined, { root: true })
} else {
await this.$store.dispatch(
this.$store.dispatch(
'webrtc/toggleMute',
{ kind, peerId: p2p.id },
{ root: true },
Expand Down
8 changes: 7 additions & 1 deletion components/views/navigation/sidebar/controls/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { mapState } from 'vuex'
import { Peer2Peer } from '~/libraries/WebRTC/Libp2p'
import { PeerMutedState } from '~/store/webrtc/types'
import { WebRTCEnum } from '~/libraries/Enums/enums'
import { RootState } from '~/types/store/store'
const p2p = Peer2Peer.getInstance()
export default Vue.extend({
Expand All @@ -33,7 +34,12 @@ export default Vue.extend({
}
},
computed: {
...mapState(['audio', 'video', 'webrtc', 'accounts']),
...mapState({
audio: (state) => (state as RootState).audio,
video: (state) => (state as RootState).video,
webrtc: (state) => (state as RootState).webrtc,
accounts: (state) => (state as RootState).accounts,
}),
audioMuted(): boolean {
return this.audio.muted
},
Expand Down

0 comments on commit 7911415

Please sign in to comment.