Fix/always on boot (#1062)

In case of 'always-on' feature has switched on, after the reboot the service do not start properly in all cases.
If the device is in offline state (no internet connection) the auth login steps will fail and the service will stop.
For the auth steps make no sense in this case because if the OS start the service we do not have option for
the user interaction.
This commit is contained in:
Zoltan Papp
2023-08-11 11:51:39 +02:00
committed by GitHub
parent 06125acb8d
commit 2dec016201
3 changed files with 27 additions and 6 deletions

View File

@ -61,7 +61,7 @@ func (n *notifier) clientStart() {
n.serverStateLock.Lock()
defer n.serverStateLock.Unlock()
n.currentClientState = true
n.lastNotification = stateConnected
n.lastNotification = stateConnecting
n.notify(n.lastNotification)
}
@ -114,7 +114,7 @@ func (n *notifier) calculateState(managementConn, signalConn bool) int {
return stateConnected
}
if !managementConn && !signalConn {
if !managementConn && !signalConn && !n.currentClientState {
return stateDisconnected
}