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

Update setExtraActionCallback whenever the tournament changes #2607

Conversation

dexonsmith
Copy link
Contributor

After f0a617a, tournament is immutable state (new copy on changes), not a mutable ref, so the renderExtraPlayerActions callback wasn't being kept up-to-date when the tournament changed. Split it out to its own useEffect that updates when the relevant tournament fields do.

Tested:

  • Director of started tournament (disqualify and adjust points)
  • Director of not-started tournament (kick)
  • Non-director (no actions)
  • Switching between them via the search box, which reuses the same component

Fixes #2606

After f0a617a, tournament is immutable state
(new copy on changes), not a mutable ref, so the renderExtraPlayerActions
callback wasn't being kept up-to-date when the tournament changed.  Split it
out to its own `useEffect` that updates when the relevant tournament fields do.

Tested:

- Director of started tournament (disqualify and adjust points)
- Director of not-started tournament (kick)
- Non-director (no actions)
- Switching between them via the search box, which reuses the same component

Fixes online-go#2606
Copy link

github-actions bot commented Feb 29, 2024

Uffizzi Preview deployment-47560 was deleted.

@anoek
Copy link
Member

anoek commented Feb 29, 2024

Awesome thanks for digging into that and getting a fix so quick!

@anoek anoek merged commit 30d37a8 into online-go:devel Feb 29, 2024
4 checks passed
@dexonsmith dexonsmith deleted the update-setExtraActionCallback-when-tournament-changes branch February 29, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tournament moderation tools broken by f0a617aa009781d1fcbb7074df04e0ac7b68edb2
2 participants