In GithubSweeperComponent.handleCellClick, the early guard returns when grid[y][x].flagged is true before the right-click / ctrl-click branch that calls toggleFlag.
Effect
Players can flag a cell but cannot unflag it through the click handler (the UI path). toggleFlag itself correctly flips both ways.
Repro (unit)
Pinned by github-sweeper.component.spec.ts — "BUG: handleCellClick cannot unflag".
Fix sketch
Reorder so the flag toggle runs before (or instead of) the flagged early-return, e.g. check button === 2 || ctrlKey first, then bail on revealed/gameOver.
## Bug
In `GithubSweeperComponent.handleCellClick`, the early guard returns when `grid[y][x].flagged` is true **before** the right-click / ctrl-click branch that calls `toggleFlag`.
## Effect
Players can flag a cell but cannot unflag it through the click handler (the UI path). `toggleFlag` itself correctly flips both ways.
## Repro (unit)
Pinned by `github-sweeper.component.spec.ts` — "BUG: handleCellClick cannot unflag".
## Fix sketch
Reorder so the flag toggle runs before (or instead of) the flagged early-return, e.g. check `button === 2 || ctrlKey` first, then bail on revealed/gameOver.
Already present on spikersoft-angularmaster. handleCellClick runs the right-click/ctrl flag toggle before the flagged early-return, so cells can be unflagged. Closing.
Already present on `spikersoft-angular` `master`. `handleCellClick` runs the right-click/ctrl flag toggle before the flagged early-return, so cells can be unflagged. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
In
GithubSweeperComponent.handleCellClick, the early guard returns whengrid[y][x].flaggedis true before the right-click / ctrl-click branch that callstoggleFlag.Effect
Players can flag a cell but cannot unflag it through the click handler (the UI path).
toggleFlagitself correctly flips both ways.Repro (unit)
Pinned by
github-sweeper.component.spec.ts— "BUG: handleCellClick cannot unflag".Fix sketch
Reorder so the flag toggle runs before (or instead of) the flagged early-return, e.g. check
button === 2 || ctrlKeyfirst, then bail on revealed/gameOver.Already present on
spikersoft-angularmaster.handleCellClickruns the right-click/ctrl flag toggle before the flagged early-return, so cells can be unflagged. Closing.