-
Notifications
You must be signed in to change notification settings - Fork 808
fix: show Spectate instead of Keep Playing on win modal when dead Closes #3058 #3062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe Win modal's button label logic was changed: it now shows "Keep" only when the current player is alive; otherwise it shows "Spectate" (e.g., dead players will see "Spectate" even if their team won). No other UI structure or exported signatures were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@GhadiSaab also please update your description with the template/checkboxes |
i have made the changes |
Thanks. If you want a re-review you can click the button to the right of evanpelle's name under Reviewers. I'll also let him know in the discord. |
3100558
Description:
This PR resolves issue #3058 where the "win modal" incorrectly
displayed a "Keep Playing" button instead of "Spectate" when a
player's team won but the player themselves was already dead.
The Problem
In WinModal.ts, the button text logic only checked
this.isWin(whether the team won) but didn't verify if the player was still alive.
This caused dead players on winning teams to see "Keep Playing"
instead of "Spectate".
The Solution
Updated the button rendering logic in
src/client/graphics/layers/WinModal.ts:82to check both the wincondition AND the player's alive status:
This approach maintains clean separation of concerns:
(true/false)
status
state
Behavior After Fix
Testing Performed
eliminated state in Teams mode.
ensure no regressions in the UI layer.
with the project's TypeScript strictness.
Closes #3058
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
ghadi8097