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 = () => { ...@@ -139,6 +139,9 @@ export const Component: React.FC = () => {
who={Who.Op} who={Who.Op}
player={op} player={op}
btn={ btn={
room.stage === RoomStage.WAITING ? (
<></>
) : (
<MoraAvatar <MoraAvatar
mora={ mora={
op?.moraResult !== undefined && op?.moraResult !== undefined &&
...@@ -147,6 +150,7 @@ export const Component: React.FC = () => { ...@@ -147,6 +150,7 @@ export const Component: React.FC = () => {
: undefined : undefined
} }
/> />
)
} }
/> />
</div> </div>
...@@ -314,7 +318,8 @@ const ActionButton: React.FC<{ ...@@ -314,7 +318,8 @@ const ActionButton: React.FC<{
onMoraSelect: (mora: Mora) => void; onMoraSelect: (mora: Mora) => void;
onTpSelect: (tp: Tp) => void; onTpSelect: (tp: Tp) => void;
}> = ({ onMoraSelect, onTpSelect }) => { }> = ({ onMoraSelect, onTpSelect }) => {
const { stage, isHost } = useSnapshot(roomStore); const room = useSnapshot(roomStore);
const { stage, isHost } = room;
return ( return (
<MoraPopover onSelect={onMoraSelect}> <MoraPopover onSelect={onMoraSelect}>
<TpPopover onSelect={onTpSelect}> <TpPopover onSelect={onTpSelect}>
...@@ -322,7 +327,10 @@ const ActionButton: React.FC<{ ...@@ -322,7 +327,10 @@ const ActionButton: React.FC<{
className={styles["btns-action"]} className={styles["btns-action"]}
disabled={ disabled={
stage !== RoomStage.WAITING || stage !== RoomStage.WAITING ||
(stage === RoomStage.WAITING && !isHost) (stage === RoomStage.WAITING &&
(!isHost ||
room.getMePlayer()?.state !== PlayerState.READY ||
room.getOpPlayer()?.state !== PlayerState.READY))
} }
onClick={() => { onClick={() => {
sendHsStart(); 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