aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfPlayApp.client.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components/GolfPlayApp.client.tsx')
-rw-r--r--frontend/app/components/GolfPlayApp.client.tsx9
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}
/>
);