-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luci-app-usteer: filter repeated SSIDs in config #6912
Conversation
When the SSID name was the same in different radio, they appear repeated in the options. This commit filter them. Signed-off-by: Miguel Angel Mulero Martinez <migmul@gmail.com>
f9f57dd
to
6b423ad
Compare
Could you walk me through what the change does please? |
This UI element contains the list of wireless SSIDs available. When the 2.4 and 5 GHz networks have the same SSID, the name appears twice in the list. |
Sorry, I wasn't clear. I meant the if conditions now: if (wifiNetwork.getSSID() && (!o.keylist || o.keylist.indexOf(wifiNetwork.getSSID()) === -1)) {
o.value(wifiNetwork.getSSID())
} I just had to stare at it for another minute to parse it :) |
Does the change work for you, @Ramon00 ? |
I arrived to the condition after testing and looking into the debugger...
|
I read the code as: This method verifies that the list of the UI is empty (in which case it is safe to add any SSID, the first), and
I read the code as: When the list is not empty, this returns true when the SSID is NOT already in the list This is your intention, I guess - because that's what seems to me would be appropriate here. |
I tested it and it for me it works fine. |
Ok. Thank you @McGiverGim and @Ramon00 |
When the SSID name was the same in different radio, they appear repeated in the options. This commit filter them.
Signed-off-by: Miguel Angel Mulero Martinez
This change was after a discussion in of #6908