Correct small JS bug
Context: The "Manage Legacy API Token usage" page, used for migrating the legacy API Token. Problem: If you click on a line, the checkbox is checked and the line is highlighted. But if you click on the checkbox, the behavior should be the same. This is not the case for all the lines, except the last one. Root cause: In the code, I used a `var` inside a loop. Due to the JS behavior, the `var` are not scoped to their "block", but to their "function block". That results in the `onCheckChanged(checkBox)`, the checkBox change it's value, due to the closure, that keep the reference to a variable that is changed. Solution: Either using `let` instead of `var` or using the `this` that corresponds to the checkbox in this case.
Please register or sign in to comment