control/controlclient: use less battery when stopped, stop map requests

Updates #604

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-07-31 09:39:45 -07:00
committed by Brad Fitzpatrick
parent dd97111d06
commit a275b9d7aa
2 changed files with 71 additions and 9 deletions

View File

@@ -1069,6 +1069,7 @@ func (b *LocalBackend) enterState(newState State) {
b.state = newState
prefs := b.prefs
notify := b.notify
bc := b.c
b.mu.Unlock()
if state == newState {
@@ -1080,6 +1081,10 @@ func (b *LocalBackend) enterState(newState State) {
b.send(Notify{State: &newState})
}
if bc != nil {
bc.SetPaused(newState == Stopped)
}
switch newState {
case NeedsLogin:
b.blockEngineUpdates(true)