diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-03 22:18:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-03 22:18:38 +0900 |
| commit | c5f340afc2ecdbff9f0d2e0707f310fa88f5af12 (patch) | |
| tree | bdef0421d29b9ee737e869677166d4b3ebdadb0f /frontend/app/components/GolfPlayApp.client.tsx | |
| parent | db06c9332776b41b3fef537f9e6d76d38f0463b3 (diff) | |
| parent | 7a4171d021a709e0af1e0e13830514c67ec97702 (diff) | |
| download | phperkaigi-2025-albatross-c5f340afc2ecdbff9f0d2e0707f310fa88f5af12.tar.gz phperkaigi-2025-albatross-c5f340afc2ecdbff9f0d2e0707f310fa88f5af12.tar.zst phperkaigi-2025-albatross-c5f340afc2ecdbff9f0d2e0707f310fa88f5af12.zip | |
Merge branch 'feat/worker'
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} /> ); |
