Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/duel-interface/Duel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ export function Duel({
};
}, [duelFinished, onDuelFinished]);

// A disconnect (either side) can happen while this player is still waiting
// on the opponent's action (their turn, a block decision, etc.). Nothing
// ever sends a matching end_wait for that, so without this the "Wait"
// popup stays open on top of "Opponent Disconnected"/"Disconnected" and
// hides their Leave Duel button, since all three share the same z-index
// and "Wait" renders later in the DOM.
useEffect(() => {
if (!opponentDisconnected && !reconnecting) {
return;
}

setWait("");
}, [opponentDisconnected, reconnecting]);

const duelFinishedWinner =
duelFinished?.winner?.username ?? duelFinished?.winner?.uid ?? "No winner";

Expand Down
Loading