Release 2.7.3.3: dark theme and Amnezia vpn:// import fixes.

This commit is contained in:
M4
2026-07-29 19:49:48 +03:00
parent 041cbb1250
commit 64c097d1e7
23 changed files with 401 additions and 69 deletions
+16 -2
View File
@@ -90,7 +90,17 @@ func (c *Config) UpsertProfile(name, proxy string) error {
}
// UpsertProfileWithProtocol creates/updates a profile and optionally sets protocol.
// The upserted profile becomes Active.
func (c *Config) UpsertProfileWithProtocol(name, proxy string, proto Protocol) error {
return c.upsertProfile(name, proxy, proto, true)
}
// UpsertProfileKeepActive creates/updates a profile without changing Active.
func (c *Config) UpsertProfileKeepActive(name, proxy string, proto Protocol) error {
return c.upsertProfile(name, proxy, proto, false)
}
func (c *Config) upsertProfile(name, proxy string, proto Protocol, activate bool) error {
name = strings.TrimSpace(name)
if name == "" {
return fmt.Errorf("имя профиля пустое")
@@ -110,7 +120,9 @@ func (c *Config) UpsertProfileWithProtocol(name, proxy string, proto Protocol) e
if len(c.Profiles[i].Listen) == 0 {
c.Profiles[i].Listen = defaultListen()
}
c.Active = name
if activate {
c.Active = name
}
return nil
}
}
@@ -121,7 +133,9 @@ func (c *Config) UpsertProfileWithProtocol(name, proxy string, proto Protocol) e
Proxy: proxy,
Listen: defaultListen(),
})
c.Active = name
if activate {
c.Active = name
}
return nil
}