Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network applet: fixes to # of visible networks (#12417)
* network applet: fix accounting of menu indexes In _createSection() and _createNetworkItem(), previously we would skip the menu index in which the active network is present. If this index was < NUM_VISIBLE_NETWORKS, then we could display too few networks before we begin stashing them in the "more" menu. _accessPointAdded() is also refactored to more closely resemble the above two, but this is a nonbehavioral change. * network applet: keep visible networks under limit When adding a network, if we add it to a menu index < NUM_VISIBLE_NETWORKS, if we now have > NUM_VISIBLE_NETWORKS networks, we need to push the last visible network to being the first network in the "more" menu. Otherwise, we could end up with too many visible networks. When updating a network position, we first removed it from the menu. When doing this, if its original menu index was < NUM_VISIBLE_NETWORKS, then we need to bump the first network in the "more" menu to being the last visible network. We now do this by now calling the already existing _accessPointRemoved() method which handles this case. Otherwise, we could end up with too few visible networks.
- Loading branch information