mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-12 04:46:46 +02:00
[client] [ui] issue when changing setting in GUI while peer session is expired (#3334)
* [client] [ui] fix issue when changing settings in GUI while peer session is expired
This commit is contained in:
parent
bd381d59cd
commit
50926bdbb4
@ -732,7 +732,6 @@ func (s *serviceClient) onTrayReady() {
|
|||||||
}
|
}
|
||||||
if err := s.updateConfig(); err != nil {
|
if err := s.updateConfig(); err != nil {
|
||||||
log.Errorf("failed to update config: %v", err)
|
log.Errorf("failed to update config: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
case <-s.mAutoConnect.ClickedCh:
|
case <-s.mAutoConnect.ClickedCh:
|
||||||
if s.mAutoConnect.Checked() {
|
if s.mAutoConnect.Checked() {
|
||||||
@ -742,7 +741,6 @@ func (s *serviceClient) onTrayReady() {
|
|||||||
}
|
}
|
||||||
if err := s.updateConfig(); err != nil {
|
if err := s.updateConfig(); err != nil {
|
||||||
log.Errorf("failed to update config: %v", err)
|
log.Errorf("failed to update config: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
case <-s.mEnableRosenpass.ClickedCh:
|
case <-s.mEnableRosenpass.ClickedCh:
|
||||||
if s.mEnableRosenpass.Checked() {
|
if s.mEnableRosenpass.Checked() {
|
||||||
@ -752,7 +750,6 @@ func (s *serviceClient) onTrayReady() {
|
|||||||
}
|
}
|
||||||
if err := s.updateConfig(); err != nil {
|
if err := s.updateConfig(); err != nil {
|
||||||
log.Errorf("failed to update config: %v", err)
|
log.Errorf("failed to update config: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
case <-s.mAdvancedSettings.ClickedCh:
|
case <-s.mAdvancedSettings.ClickedCh:
|
||||||
s.mAdvancedSettings.Disable()
|
s.mAdvancedSettings.Disable()
|
||||||
@ -967,17 +964,20 @@ func (s *serviceClient) updateConfig() error {
|
|||||||
|
|
||||||
// restartClient restarts the client connection.
|
// restartClient restarts the client connection.
|
||||||
func (s *serviceClient) restartClient(loginRequest *proto.LoginRequest) error {
|
func (s *serviceClient) restartClient(loginRequest *proto.LoginRequest) error {
|
||||||
|
ctx, cancel := context.WithTimeout(s.ctx, defaultFailTimeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
client, err := s.getSrvClient(failFastTimeout)
|
client, err := s.getSrvClient(failFastTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = client.Login(s.ctx, loginRequest)
|
_, err = client.Login(ctx, loginRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = client.Up(s.ctx, &proto.UpRequest{})
|
_, err = client.Up(ctx, &proto.UpRequest{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user