@@ -31,7 +31,7 @@ const callTimer = ref<number | null>(null);
3131
3232const hideTimeout = ref <number | null >(4 );
3333const countdownInterval = ref <number | null >(null );
34- let isTouch = " ontouchstart " in window ;
34+ let isTouch = " ontouchend " in window ;
3535
3636// Cleanup functions
3737let watchers: (() => void )[] = [];
@@ -121,12 +121,12 @@ function setupEventListeners() {
121121 e .preventDefault ();
122122 showControls ();
123123 };
124- element .addEventListener (" touchstart " , touchHandler );
124+ element .addEventListener (" touchend " , touchHandler );
125125 element .addEventListener (" touchmove" , touchHandler );
126126
127127 // Cleanup function to remove touch listeners
128128 return () => {
129- element .removeEventListener (" touchstart " , touchHandler );
129+ element .removeEventListener (" touchend " , touchHandler );
130130 element .removeEventListener (" touchmove" , touchHandler );
131131 };
132132 } else {
@@ -285,14 +285,15 @@ onBeforeUnmount(() => {
285285 type =" button"
286286 class =" h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-green-500 text-color-white"
287287 @click =" callStore.acceptCall()"
288- v-on:focus = " console.log('clicked' )"
288+ @touchend = " callStore.acceptCall( )"
289289 >
290290 <IconCall :size =" 40" />
291291 </button >
292292 <button
293293 type =" button"
294294 class =" h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
295295 @click =" callStore.hangup(callStore.currentCallState.callId!)"
296+ @touchend =" callStore.hangup(callStore.currentCallState.callId!)"
296297 >
297298 <IconCall :size =" 40" :rotate =" 135" />
298299 </button >
@@ -304,20 +305,23 @@ onBeforeUnmount(() => {
304305 <button
305306 class =" h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 hover:bg-color-background-mute"
306307 @click =" video = callStore.alterVideoStream()"
308+ @touchend =" video = callStore.alterVideoStream()"
307309 >
308310 <IconVideoCall :size =" 40" v-if =" video" />
309311 <IconVideoOff :size =" 40" v-else />
310312 </button >
311313 <button
312314 class =" h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 hover:bg-color-background-mute"
313315 @click =" unMute = callStore.alterAudioStream()"
316+ @touchend =" unMute = callStore.alterAudioStream()"
314317 >
315318 <IconMic v-if =" unMute" :size =" 40" />
316319 <IconMicOff v-else :size =" 40" />
317320 </button >
318321 <button
319322 class =" h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
320323 @click =" callStore.hangup(callStore.currentCallState?.callId!)"
324+ @touchend =" callStore.hangup(callStore.currentCallState?.callId!)"
321325 >
322326 <IconCall :size =" 40" :rotate =" 135" />
323327 </button >
0 commit comments