-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Bug description
When editing a sub-affix of a relic, the change may be applied to the wrong relic slot, causing multiple relics to appear to update simultaneously.
Root cause
Inside RelicCard, the function handleSubAffixChange uses a parameter named index to represent the sub-affix index (0–3).
However, the same index is also passed directly to onRelicChange(index, ...), where the parent component expects index to represent the relic slot index.
Because function parameters shadow outer-scope variables in JavaScript/TypeScript, the sub-affix index unintentionally overrides the relic slot index. As a result, editing a sub-affix writes data to relics[0..3] instead of the current relic slot.
Probably Solution
I've made a branch with this bug fixed, and will create a pull-request soon. Check this out to see if this looks good to you.