Skip to content

fix(monkey-power): shake reset never cancelled, spark colors not padded (@boergeson) - #8380

Open
boergeson wants to merge 3 commits into
monkeytypegame:masterfrom
boergeson:fix/monkey-power-reset
Open

fix(monkey-power): shake reset never cancelled, spark colors not padded (@boergeson)#8380
boergeson wants to merge 3 commits into
monkeytypegame:masterfrom
boergeson:fix/monkey-power-reset

Conversation

@boergeson

Copy link
Copy Markdown
Contributor

Description

Two small things in monkey power:

  • reset() deleted ctx.resetTimeOut and then called clearTimeout with it, so the 2s shake reset from addPower was never cancelled. Swapped the two lines.
  • randomColor() built the hex string without padding, so any channel under 16 gave a 3 to 5 char color like #fa2 that isnt what was meant. Channels are now padded to two digits.

Added a spec for both, randomColor is exposed through __testing like a few other modules do. Both tests fail on master and pass here.

Closes #8362

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug (Monkey Power): reset() deletes timeout id before clearTimeout — pending shake reset always fires; randomColor() can emit invalid hex

2 participants