Repository navigation
fix(rewards): measure reward progress against the selected child (#1068) - #1069
Merged
Merged
Conversation
With no child_id pinned, the progress bar and points figure used the first child's points for every child, so switching tabs changed the balance and the claim button but not the bar. Both render paths now use the pinned or selected child, the same child the affordability check already uses.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1068
What was wrong
On a rewards card with no
child_idpinned, the progress bar and thex/costfigure always used the first child's points. Switching child tabs updated the spendable balance and the claim button, but every child's bar showed the first child's progress. The bar could read 100% while the claim button was disabled, or the other way round.The same line was in both render paths: the classic row (
_renderRewardRow) and the designed-style rows (_rewardData).Fix
Both paths now take the points from
relevantChild. That is the pinned child, or the selected tab when nothing is pinned, and it is the same child the affordability check already used. A pinned card behaves as before. Jackpot and pool-mode rewards are unchanged.Testing
node --test tests/frontend/*.test.cjs: 683 passed. ESLint is clean.756/1000(Malia's points); the fixed card showed638/1000on both classic and playroom. The test reward was removed afterwards.