mirror of
https://github.com/vector-im/element-call.git
synced 2026-06-15 12:12:57 +00:00
Merge pull request #3927 from element-hq/toger5/back-button-press-control-on-esc
Refactor of Escape keyboard event bahvior (allow mute/emoji shortcuts after closing a modal with escape)
This commit is contained in:
@@ -227,10 +227,7 @@ export const InCallView: FC<InCallViewProps> = ({
|
||||
const toggleVideo = useBehavior(muteStates.video.toggle$);
|
||||
const setAudioEnabled = useBehavior(muteStates.audio.setEnabled$);
|
||||
|
||||
// This function incorrectly assumes that there is a camera and microphone, which is not always the case.
|
||||
// TODO: Make sure that this module is resilient when it comes to camera/microphone availability!
|
||||
useCallViewKeyboardShortcuts(
|
||||
containerRef1,
|
||||
toggleAudio,
|
||||
toggleVideo,
|
||||
setAudioEnabled,
|
||||
|
||||
@@ -47,6 +47,7 @@ import { usePageTitle } from "../usePageTitle";
|
||||
import { getValue } from "../utils/observable";
|
||||
import { useBehavior } from "../useBehavior";
|
||||
import { CallFooter } from "../components/CallFooter";
|
||||
import { useCallViewKeyboardShortcuts } from "../useCallViewKeyboardShortcuts";
|
||||
|
||||
interface Props {
|
||||
client: MatrixClient;
|
||||
@@ -91,6 +92,11 @@ export const LobbyView: FC<Props> = ({
|
||||
const [settingsModalOpen, setSettingsModalOpen] = useState(false);
|
||||
const [settingsTab, setSettingsTab] = useState(defaultSettingsTab);
|
||||
|
||||
// This function incorrectly assumes that there is a camera and microphone, which is not always the case.
|
||||
// TODO: Make sure that this module is resilient when it comes to camera/microphone availability!
|
||||
// Next to the keyboard shortcuts, this is also responsible for catching escape key presses and forwarding the to mobile -> pip.
|
||||
useCallViewKeyboardShortcuts(toggleAudio, toggleVideo, null, null, null);
|
||||
|
||||
const openSettings = useCallback(
|
||||
() => setSettingsModalOpen(true),
|
||||
[setSettingsModalOpen],
|
||||
|
||||
Reference in New Issue
Block a user