Skip to content

Commit 47f184b

Browse files
committed
feat(call controls): add audio toggle functionality - watchEffect
1 parent 9a73fee commit 47f184b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/CallControls.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
<script>
3636
import daily from "@daily-co/daily-js";
37-
import { ref } from "vue";
37+
import { ref, watchEffect } from "vue";
38+
import { useMagicKeys } from '@vueuse/core';
3839
3940
import leave from "../assets/leave_call.svg";
4041
import micOff from "../assets/mic_off.svg";
@@ -53,9 +54,17 @@ export default {
5354
"leaveCall",
5455
"disableScreenShare",
5556
],
56-
setup() {
57+
setup(props) {
5758
const supportsScreenshare = ref(false)
5859
60+
const { ctrl, m } = useMagicKeys()
61+
62+
watchEffect(() => {
63+
if(ctrl.value && m.value) {
64+
props.handleAudioClick()
65+
}
66+
})
67+
5968
return {
6069
supportsScreenshare
6170
}

0 commit comments

Comments
 (0)