Refactor: allow to add an empty proxy provider to proxy group

This commit is contained in:
yaling888
2022-06-22 04:36:27 +08:00
parent e31be4edc2
commit 1f12ef069b
7 changed files with 76 additions and 48 deletions

View File

@@ -98,7 +98,11 @@ func (s *Selector) selectedProxy(touch bool) C.Proxy {
}
func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) *Selector {
selected := providers[0].Proxies()[0].Name()
selected := "REJECT"
if len(providers) != 0 && len(providers[0].Proxies()) != 0 {
selected = providers[0].Proxies()[0].Name()
}
return &Selector{
Base: outbound.NewBase(outbound.BaseOption{
Name: option.Name,