Skip to content

Commit

Permalink
🐛 fix submit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbae94 authored May 17, 2024
1 parent 0207604 commit 85fa622
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions chatty-fe/src/app/(game)/quiz-room/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ const QuizRoom = ({ params }: { params: { id: number } }) => {
setBgm('/bgm/quiz.mp3');
}, []);

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (
event.key === 'Enter' &&
!unableSubmit &&
(userAnswer || selectedOption)
) {
submitQuiz(params.id);
console.log('enter');
}
};
window.addEventListener('keydown', handleKeyDown);
return () => {
window.removeEventListener('keydown', handleKeyDown);
};
}, [unableSubmit, params.id, userAnswer, selectedOption]);

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (
Expand Down

0 comments on commit 85fa622

Please sign in to comment.