From 1184b71396350af6a7fa3d370f6708b8ed3907c2 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Wed, 19 Apr 2023 15:54:39 -0400 Subject: [PATCH] Format with Prettier --- src/useCallViewKeyboardShortcuts.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/useCallViewKeyboardShortcuts.ts b/src/useCallViewKeyboardShortcuts.ts index e753ea41..5f9c4572 100644 --- a/src/useCallViewKeyboardShortcuts.ts +++ b/src/useCallViewKeyboardShortcuts.ts @@ -24,9 +24,12 @@ import { useEventTarget } from "./useEvents"; * element (specifically, if an ancestor or descendant of it is focused). */ const mayReceiveKeyEvents = (e: HTMLElement): boolean => { - const focusedElement = document.activeElement - return focusedElement !== null && (focusedElement.contains(e) || e.contains(focusedElement)) -} + const focusedElement = document.activeElement; + return ( + focusedElement !== null && + (focusedElement.contains(e) || e.contains(focusedElement)) + ); +}; export function useCallViewKeyboardShortcuts( focusElement: RefObject, @@ -44,7 +47,7 @@ export function useCallViewKeyboardShortcuts( "keydown", useCallback( (event: KeyboardEvent) => { - if (focusElement.current === null) return + if (focusElement.current === null) return; if (!mayReceiveKeyEvents(focusElement.current)) return; // Check if keyboard shortcuts are enabled const keyboardShortcuts = getSetting("keyboard-shortcuts", true); @@ -59,11 +62,7 @@ export function useCallViewKeyboardShortcuts( setMicrophoneMuted(false); } }, - [ - toggleLocalVideoMuted, - toggleMicrophoneMuted, - setMicrophoneMuted, - ] + [toggleLocalVideoMuted, toggleMicrophoneMuted, setMicrophoneMuted] ) ); @@ -72,7 +71,7 @@ export function useCallViewKeyboardShortcuts( "keyup", useCallback( (event: KeyboardEvent) => { - if (focusElement.current === null) return + if (focusElement.current === null) return; if (!mayReceiveKeyEvents(focusElement.current)) return; // Check if keyboard shortcuts are enabled const keyboardShortcuts = getSetting("keyboard-shortcuts", true);