fix: provider proxies no updated

This commit is contained in:
yicheng 2020-04-29 19:52:44 +08:00
parent f744fdabfd
commit c75698a0e5
2 changed files with 5 additions and 3 deletions

View File

@ -31,8 +31,8 @@ class MenuItemFactory {
return
}
for proxy in info?.proxies ?? [] {
NotificationCenter.default.post(name: .proxyUpdate(for: proxy.name), object: proxy, userInfo: nil)
for (name, proxy) in info?.proxiesMap ?? [:] {
NotificationCenter.default.post(name: .proxyUpdate(for: name), object: proxy, userInfo: nil)
}
}
}
@ -264,7 +264,6 @@ extension MenuItemFactory {
@objc static func optionUseViewRenderMenuItemTap(sender: NSMenuItem) {
useViewToRenderProxy = !useViewToRenderProxy
updateUseViewRenderMenuItem(sender)
refreshExistingMenuItems()
recreateProxyMenuItems()
}
}

View File

@ -144,7 +144,10 @@ class ClashProxy: Codable {
}
class ClashProxyResp {
// proxies without provider
let proxies: [ClashProxy]
// proxiesmap with provider included
var proxiesMap: [ClashProxyName: ClashProxy]
private var enclosingProviderResp: ClashProviderResp?