From d6e30f7c46fb5539cd684d9258df9c6a51061f14 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sat, 15 Jan 2022 16:59:04 -0800 Subject: [PATCH] more fixes --- components/Dashboard/TeamVoiceLine.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Dashboard/TeamVoiceLine.tsx b/components/Dashboard/TeamVoiceLine.tsx index cd23dad..ac3b377 100644 --- a/components/Dashboard/TeamVoiceLine.tsx +++ b/components/Dashboard/TeamVoiceLine.tsx @@ -67,6 +67,8 @@ function renderPulse(status: UserStatus) { const maxNumberOfKeyboardMappings: number = 9; +const shortcutMappings = new Map(); // keycode number to the user id + export default function TeamVoiceLine() { const router = useRouter(); const { teamid } = router.query; @@ -139,7 +141,6 @@ export default function TeamVoiceLine() { const [selectedTeammate, setSelectedTeammate] = useState(); // id of selected teammate const [isRecording, setIsRecording] = useState(false); - const shortcutMappings = new Map(); // keycode number to the user id teamUsers.forEach((tmUser, i) => { // make sure we don't map a user if they are past the max allowed if (i < maxNumberOfKeyboardMappings) { @@ -148,6 +149,10 @@ export default function TeamVoiceLine() { } }); + useEffect(() => { + // todo move all variable stuff like shortcut mappings here + }, [teamUsers]); + function handleKeyUp(event) { console.log("on key up"); @@ -155,6 +160,7 @@ export default function TeamVoiceLine() { if (event.keyCode == KeyCode.R) { console.log("stopped recording"); setIsRecording(false); + setSelectedTeammate(null); } } @@ -165,7 +171,7 @@ export default function TeamVoiceLine() { console.log(event.keyCode); - // recordingr + // recording if (event.keyCode == KeyCode.R) { console.log("started recording"); setIsRecording(true);