mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
Seticon only when status changes (#504)
* Seticon only when status changes This prevents a memory leak with the systray lib when setting the icon every 2 seconds causes a large memory consumption see https://github.com/getlantern/systray/issues/135 * Use fork with permanent fix
This commit is contained in:
@@ -324,12 +324,12 @@ func (s *serviceClient) updateStatus() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if status.Status == string(internal.StatusConnected) {
|
||||
if status.Status == string(internal.StatusConnected) && !s.mUp.Disabled() {
|
||||
systray.SetIcon(s.icConnected)
|
||||
s.mStatus.SetTitle("Connected")
|
||||
s.mUp.Disable()
|
||||
s.mDown.Enable()
|
||||
} else {
|
||||
} else if status.Status != string(internal.StatusConnected) && s.mUp.Disabled() {
|
||||
systray.SetIcon(s.icDisconnected)
|
||||
s.mStatus.SetTitle("Disconnected")
|
||||
s.mDown.Disable()
|
||||
|
||||
Reference in New Issue
Block a user