From b203d09a8af7960556077d0cd95f3c4a5bc4f000 Mon Sep 17 00:00:00 2001 From: bbb169 <827088092@qq.com> Date: Sun, 22 Oct 2023 15:09:26 +0800 Subject: [PATCH] fix: button player should turn to next game when room settling --- .../playRoom/component/waitingStart/index.tsx | 14 +++++++++++++- src/pages/playRoom/index.tsx | 3 +-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pages/playRoom/component/waitingStart/index.tsx b/src/pages/playRoom/component/waitingStart/index.tsx index 1fa389f..a17fc9f 100644 --- a/src/pages/playRoom/component/waitingStart/index.tsx +++ b/src/pages/playRoom/component/waitingStart/index.tsx @@ -1,7 +1,19 @@ +import { emitSocket } from '@/utils/api.js'; import { Button, Space } from 'antd'; import { startGame } from '../../api.js'; +import { RoomInfo } from '../../type.js'; -export default function WaitingStart ({ isButtonPosition, hasOtherPlayers }: { isButtonPosition: boolean, hasOtherPlayers: number }) { +export default function WaitingStart ({ isButtonPosition, hasOtherPlayers, room }: { isButtonPosition: boolean; hasOtherPlayers: number; room: RoomInfo}) { + if (room.statu === 'started') { + return <>; + } else if (room.statu === 'settling') { + return isButtonPosition + ? + : ; + } + return isButtonPosition && hasOtherPlayers ?