Commit dbaab022 authored by Chunchi Che's avatar Chunchi Che

optimize WaitRoom

parent 3a3e233a
Pipeline #23002 passed with stages
in 15 minutes and 31 seconds
......@@ -139,6 +139,9 @@ export const Component: React.FC = () => {
who={Who.Op}
player={op}
btn={
room.stage === RoomStage.WAITING ? (
<></>
) : (
<MoraAvatar
mora={
op?.moraResult !== undefined &&
......@@ -147,6 +150,7 @@ export const Component: React.FC = () => {
: undefined
}
/>
)
}
/>
</div>
......@@ -314,7 +318,8 @@ const ActionButton: React.FC<{
onMoraSelect: (mora: Mora) => void;
onTpSelect: (tp: Tp) => void;
}> = ({ onMoraSelect, onTpSelect }) => {
const { stage, isHost } = useSnapshot(roomStore);
const room = useSnapshot(roomStore);
const { stage, isHost } = room;
return (
<MoraPopover onSelect={onMoraSelect}>
<TpPopover onSelect={onTpSelect}>
......@@ -322,7 +327,10 @@ const ActionButton: React.FC<{
className={styles["btns-action"]}
disabled={
stage !== RoomStage.WAITING ||
(stage === RoomStage.WAITING && !isHost)
(stage === RoomStage.WAITING &&
(!isHost ||
room.getMePlayer()?.state !== PlayerState.READY ||
room.getOpPlayer()?.state !== PlayerState.READY))
}
onClick={() => {
sendHsStart();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment