diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-29 20:04:26 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-29 20:04:26 +0900 |
| commit | 9e47a0ecc9416a0fa0b09201882d1da5b11ebaff (patch) | |
| tree | f368aa1ef1d734d3096c9129e17d6af11d1041a6 /frontend/app/components/GolfPlayApp.tsx | |
| parent | 3f95e0e6d62267cf8863e98f3ab7de8971a91000 (diff) | |
| parent | 648613e24c8afe5fd3c599def61b33ccf7bcb96c (diff) | |
| download | phperkaigi-2025-albatross-9e47a0ecc9416a0fa0b09201882d1da5b11ebaff.tar.gz phperkaigi-2025-albatross-9e47a0ecc9416a0fa0b09201882d1da5b11ebaff.tar.zst phperkaigi-2025-albatross-9e47a0ecc9416a0fa0b09201882d1da5b11ebaff.zip | |
Merge branch 'game-watching'
Diffstat (limited to 'frontend/app/components/GolfPlayApp.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApp.tsx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/frontend/app/components/GolfPlayApp.tsx b/frontend/app/components/GolfPlayApp.tsx index c6c20d4..3cb512a 100644 --- a/frontend/app/components/GolfPlayApp.tsx +++ b/frontend/app/components/GolfPlayApp.tsx @@ -15,12 +15,18 @@ type Problem = components["schemas"]["Problem"]; type GameState = "connecting" | "waiting" | "starting" | "gaming" | "finished"; -export default function GolfPlayApp({ game }: { game: Game }) { - // const socketUrl = `wss://t.nil.ninja/iosdc/2024/sock/golf/${game.game_id}/play`; +export default function GolfPlayApp({ + game, + sockToken, +}: { + game: Game; + sockToken: string; +}) { + // const socketUrl = `wss://t.nil.ninja/iosdc/2024/sock/golf/${game.game_id}/play?token=${sockToken}`; const socketUrl = process.env.NODE_ENV === "development" - ? `ws://localhost:8002/sock/golf/${game.game_id}/play` - : `ws://api-server/sock/golf/${game.game_id}/play`; + ? `ws://localhost:8002/sock/golf/${game.game_id}/play?token=${sockToken}` + : `ws://api-server/sock/golf/${game.game_id}/play?token=${sockToken}`; const { sendJsonMessage, lastJsonMessage, readyState } = useWebSocket<WebSocketMessage>(socketUrl, {}); @@ -66,7 +72,6 @@ export default function GolfPlayApp({ game }: { game: Game }) { }, [gameState, startedAt, game.duration_seconds]); const [currentScore, setCurrentScore] = useState<number | null>(null); - void setCurrentScore; const onCodeChange = useDebouncedCallback((code: string) => { console.log("player:c2s:code"); |
