Disable keyboard shortcuts when feedback modal is open
This commit is contained in:
		
					parent
					
						
							
								30688715cd
							
						
					
				
			
			
				commit
				
					
						9ba4ce429f
					
				
			
		
					 4 changed files with 106 additions and 64 deletions
				
			
		| 
						 | 
				
			
			@ -63,6 +63,7 @@ import { usePrefersReducedMotion } from "../usePrefersReducedMotion";
 | 
			
		|||
import { ParticipantInfo } from "./useGroupCall";
 | 
			
		||||
import { TileDescriptor } from "../video-grid/TileDescriptor";
 | 
			
		||||
import { AudioSink } from "../video-grid/AudioSink";
 | 
			
		||||
import { useKeyboardShortcuts } from "../useKeyboardShortcuts";
 | 
			
		||||
 | 
			
		||||
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
 | 
			
		||||
// There is currently a bug in Safari our our code with cloning and sending MediaStreams
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +82,7 @@ interface Props {
 | 
			
		|||
  toggleLocalVideoMuted: () => void;
 | 
			
		||||
  toggleMicrophoneMuted: () => void;
 | 
			
		||||
  toggleScreensharing: () => void;
 | 
			
		||||
  setMicrophoneMuted: (muted: boolean) => void;
 | 
			
		||||
  userMediaFeeds: CallFeed[];
 | 
			
		||||
  activeSpeaker: CallFeed | null;
 | 
			
		||||
  onLeave: () => void;
 | 
			
		||||
| 
						 | 
				
			
			@ -101,6 +103,7 @@ export function InCallView({
 | 
			
		|||
  localVideoMuted,
 | 
			
		||||
  toggleLocalVideoMuted,
 | 
			
		||||
  toggleMicrophoneMuted,
 | 
			
		||||
  setMicrophoneMuted,
 | 
			
		||||
  userMediaFeeds,
 | 
			
		||||
  activeSpeaker,
 | 
			
		||||
  onLeave,
 | 
			
		||||
| 
						 | 
				
			
			@ -141,6 +144,13 @@ export function InCallView({
 | 
			
		|||
 | 
			
		||||
  const { hideScreensharing } = useUrlParams();
 | 
			
		||||
 | 
			
		||||
  useKeyboardShortcuts(
 | 
			
		||||
    !feedbackModalState.isOpen,
 | 
			
		||||
    toggleMicrophoneMuted,
 | 
			
		||||
    toggleLocalVideoMuted,
 | 
			
		||||
    setMicrophoneMuted
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    widget?.api.transport.send(
 | 
			
		||||
      layout === "freedom"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue