fix: remove global mode filter again

This commit is contained in:
yicheng 2020-04-08 11:24:13 +08:00
parent 9e758384b8
commit 7e06f08aad
1 changed files with 5 additions and 1 deletions

View File

@ -102,6 +102,11 @@ class MenuItemFactory {
proxyInfo: ClashProxyResp) -> NSMenuItem? { proxyInfo: ClashProxyResp) -> NSMenuItem? {
let proxyMap = proxyInfo.proxiesMap let proxyMap = proxyInfo.proxiesMap
let isGlobalMode = ConfigManager.shared.currentConfig?.mode == .global
if !isGlobalMode {
if proxyGroup.name == "GLOBAL" { return nil }
}
let menu = NSMenuItem(title: proxyGroup.name, action: nil, keyEquivalent: "") let menu = NSMenuItem(title: proxyGroup.name, action: nil, keyEquivalent: "")
let selectedName = proxyGroup.now ?? "" let selectedName = proxyGroup.now ?? ""
if !ConfigManager.shared.disableShowCurrentProxyInMenu { if !ConfigManager.shared.disableShowCurrentProxyInMenu {
@ -113,7 +118,6 @@ class MenuItemFactory {
for proxy in proxyGroup.all ?? [] { for proxy in proxyGroup.all ?? [] {
guard let proxyModel = proxyMap[proxy] else { continue } guard let proxyModel = proxyMap[proxy] else { continue }
let proxyItem = ProxyMenuItem(proxy: proxyModel, let proxyItem = ProxyMenuItem(proxy: proxyModel,
action: #selector(MenuItemFactory.actionSelectProxy(sender:)), action: #selector(MenuItemFactory.actionSelectProxy(sender:)),
selected: proxy == selectedName, selected: proxy == selectedName,