ipn: convert an int to a bool

pull/842/head
Brad Fitzpatrick 4 years ago
parent a3f17b8108
commit e72f480d22

@ -90,7 +90,7 @@ type LocalBackend struct {
endpoints []string endpoints []string
blocked bool blocked bool
authURL string authURL string
interact int interact bool
prevIfState *interfaces.State prevIfState *interfaces.State
// statusLock must be held before calling statusChanged.Wait() or // statusLock must be held before calling statusChanged.Wait() or
@ -315,7 +315,7 @@ func (b *LocalBackend) setClientStatus(st controlclient.Status) {
} }
if st.URL != "" { if st.URL != "" {
b.logf("Received auth URL: %.20v...", st.URL) b.logf("Received auth URL: %.20v...", st.URL)
if interact > 0 { if interact {
b.popBrowserAuthNow() b.popBrowserAuthNow()
} }
} }
@ -671,7 +671,7 @@ func (b *LocalBackend) send(n Notify) {
func (b *LocalBackend) popBrowserAuthNow() { func (b *LocalBackend) popBrowserAuthNow() {
b.mu.Lock() b.mu.Lock()
url := b.authURL url := b.authURL
b.interact = 0 b.interact = false
b.authURL = "" b.authURL = ""
b.mu.Unlock() b.mu.Unlock()
@ -855,7 +855,7 @@ func (b *LocalBackend) Login(token *oauth2.Token) {
func (b *LocalBackend) StartLoginInteractive() { func (b *LocalBackend) StartLoginInteractive() {
b.mu.Lock() b.mu.Lock()
b.assertClientLocked() b.assertClientLocked()
b.interact++ b.interact = true
url := b.authURL url := b.authURL
c := b.c c := b.c
b.mu.Unlock() b.mu.Unlock()

Loading…
Cancel
Save