summaryrefslogtreecommitdiff
path: root/pkg/systray
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/systray')
-rw-r--r--pkg/systray/config.go6
-rw-r--r--pkg/systray/run.go2
2 files changed, 3 insertions, 5 deletions
diff --git a/pkg/systray/config.go b/pkg/systray/config.go
index 2755851..e53dea9 100644
--- a/pkg/systray/config.go
+++ b/pkg/systray/config.go
@@ -45,6 +45,7 @@ type Config struct {
}
SelectGateway bool
DisableAustostart bool
+ StartVPN bool
Version string
Printer *message.Printer
}
@@ -65,6 +66,7 @@ func ParseConfig() *Config {
conf.SelectGateway = conf.file.SelectGateway
conf.DisableAustostart = conf.file.DisableAustostart
+ conf.StartVPN = !conf.file.UserStoppedVPN
return &conf
}
@@ -73,10 +75,6 @@ func (c *Config) setUserStoppedVPN(vpnStopped bool) error {
return c.save()
}
-func (c *Config) wasUserStopped() bool {
- return c.file.UserStoppedVPN
-}
-
func (c *Config) hasDonated() bool {
return c.file.Donated.Add(oneMonth).After(time.Now())
}
diff --git a/pkg/systray/run.go b/pkg/systray/run.go
index 2878928..172b9e8 100644
--- a/pkg/systray/run.go
+++ b/pkg/systray/run.go
@@ -98,7 +98,7 @@ func checkAndInstallHelpers(b bitmask.Bitmask, notify *notificator) error {
}
func maybeStartVPN(b bitmask.Bitmask, conf *Config) error {
- if conf.wasUserStopped() {
+ if !conf.StartVPN {
return nil
}