Skip to content
Unverified Commit dd13c42d authored by Wadeck Follonier's avatar Wadeck Follonier Committed by GitHub
Browse files

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.
parent 4d54883e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment