From 7e06f08aad40de30deb62e304a0e79ae302ea110 Mon Sep 17 00:00:00 2001 From: yicheng <11733500+yichengchen@users.noreply.github.com> Date: Wed, 8 Apr 2020 11:24:13 +0800 Subject: [PATCH] fix: remove global mode filter again --- ClashX/General/Managers/MenuItemFactory.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ClashX/General/Managers/MenuItemFactory.swift b/ClashX/General/Managers/MenuItemFactory.swift index 74d6c00..60d0af1 100644 --- a/ClashX/General/Managers/MenuItemFactory.swift +++ b/ClashX/General/Managers/MenuItemFactory.swift @@ -102,6 +102,11 @@ class MenuItemFactory { proxyInfo: ClashProxyResp) -> NSMenuItem? { 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 selectedName = proxyGroup.now ?? "" if !ConfigManager.shared.disableShowCurrentProxyInMenu { @@ -113,7 +118,6 @@ class MenuItemFactory { for proxy in proxyGroup.all ?? [] { guard let proxyModel = proxyMap[proxy] else { continue } - let proxyItem = ProxyMenuItem(proxy: proxyModel, action: #selector(MenuItemFactory.actionSelectProxy(sender:)), selected: proxy == selectedName,