(event: KeyboardEvent)
| 272 | |
| 273 | useEffect(() => { |
| 274 | const handleKeyPress = (event: KeyboardEvent) => { |
| 275 | if (event.key === "ArrowRight") { |
| 276 | router.push( |
| 277 | problemIndex + 1 === track.problems.length |
| 278 | ? `` |
| 279 | : `/tracks/${track.id}/${track.problems[problemIndex + 1]?.id}` |
| 280 | ); |
| 281 | } else if (event.key === "ArrowLeft") { |
| 282 | router.push(problemIndex !== 0 ? `/tracks/${track.id}/${track.problems[problemIndex - 1]?.id}` : ``); |
| 283 | } |
| 284 | }; |
| 285 | |
| 286 | window.addEventListener("keydown", handleKeyPress); |
| 287 | return () => { |
nothing calls this directly
no outgoing calls
no test coverage detected