Skip to content

Commit

Permalink
Increase unsorted maximum network list length to 200, sorted length t…
Browse files Browse the repository at this point in the history
…o 75

In 2021, it is fairly easy to have more than 100 unique BSSIDs in cities
  • Loading branch information
williambj1 committed Mar 15, 2021
1 parent 5f3c9a6 commit 51e0af5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ClientKit/Api.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>

#define MAX_NETWORK_LIST_LENGTH 50
#define MAX_NETWORK_LIST_LENGTH 200
#define MAX_SSID_LENGTH 32

typedef struct {
Expand Down
6 changes: 5 additions & 1 deletion HeliPort/Appearance/StatusMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
private let hardwareInfoSeparator = NSMenuItem.separator()

private var networkItemList = [NSMenuItem]()
private let maxNetworkListLength = MAX_NETWORK_LIST_LENGTH
// 200 will cause serious lag when scrolling
private let maxNetworkListLength = 75 // MAX_NETWORK_LIST_LENGTH
private let networkItemListSeparator: NSMenuItem = {
let networkItemListSeparator = NSMenuItem.separator()
networkItemListSeparator.isHidden = true
Expand Down Expand Up @@ -572,6 +573,9 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
NetworkManager.scanNetwork { networkList in
self.isNetworkListEmpty = networkList.count == 0 && !self.isNetworkConnected
var networkList = networkList
if networkList.count > self.networkItemList.count {
Log.error("Number of scanned networks (\(networkList.count)) exceeds maximum (\(self.networkItemList.count))")
}
for index in 1 ..< self.networkItemList.count {
if let view = self.networkItemList[index].view as? WifiMenuItemView {
if networkList.count > 0 {
Expand Down

0 comments on commit 51e0af5

Please sign in to comment.