diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-03 22:18:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-03 22:18:31 +0900 |
| commit | 7a4171d021a709e0af1e0e13830514c67ec97702 (patch) | |
| tree | bdef0421d29b9ee737e869677166d4b3ebdadb0f /frontend/app/components/GolfPlayApp.client.tsx | |
| parent | f70d6eed9f2c519aed030c9dbda99ed0435991a0 (diff) | |
| download | iosdc-japan-2024-albatross-7a4171d021a709e0af1e0e13830514c67ec97702.tar.gz iosdc-japan-2024-albatross-7a4171d021a709e0af1e0e13830514c67ec97702.tar.zst iosdc-japan-2024-albatross-7a4171d021a709e0af1e0e13830514c67ec97702.zip | |
feat: partially implement submit action
Diffstat (limited to 'frontend/app/components/GolfPlayApp.client.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApp.client.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend/app/components/GolfPlayApp.client.tsx b/frontend/app/components/GolfPlayApp.client.tsx index ace0710..80e7182 100644 --- a/frontend/app/components/GolfPlayApp.client.tsx +++ b/frontend/app/components/GolfPlayApp.client.tsx @@ -81,6 +81,14 @@ export default function GolfPlayApp({ }); }, 1000); + const onCodeSubmit = useDebouncedCallback((code: string) => { + console.log("player:c2s:submit"); + sendJsonMessage({ + type: "player:c2s:submit", + data: { code }, + }); + }, 1000); + if (readyState === ReadyState.UNINSTANTIATED) { throw new Error("WebSocket is not connected"); } @@ -140,6 +148,7 @@ export default function GolfPlayApp({ <GolfPlayAppGaming problem={problem!.description} onCodeChange={onCodeChange} + onCodeSubmit={onCodeSubmit} currentScore={currentScore} /> ); |
