Skip to content
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

"Remove Threats" button clickable in wrong situation #159

Open
ChristophNiehoff opened this issue Oct 29, 2021 · 1 comment
Open

"Remove Threats" button clickable in wrong situation #159

ChristophNiehoff opened this issue Oct 29, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ChristophNiehoff
Copy link
Collaborator

After every player has passed, but before a new card has been drawn, the "Remove Threat" button is still clickable.
The UI suggests that everything is ok, but the threat does not get removed in this corner case.

I believe it is due to

if (hasPlayerPassed(G, ctx) || (threat.owner !== ctx.playerID)) {
  return INVALID_MOVE;
}

in deleteThreats() in moves.js. One is still at a point, where hasPlayerPassed() returns true.

We should disable the Remove Threats button in this case, like done e.g. with the Add Threat button.

@ChristophNiehoff ChristophNiehoff added the bug Something isn't working label Oct 29, 2021
@ChristophNiehoff
Copy link
Collaborator Author

The same is also true for the Update Threats button.

@ChristophNiehoff ChristophNiehoff added the good first issue Good for newcomers label Oct 29, 2021
@ChristophNiehoff ChristophNiehoff changed the title Remove Threats button clickable in wrong situation "Remove Threats" button clickable in wrong situation Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant