cmd/tailscale: assume internet connectivity at startup

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/2/head
Elias Naur 6 years ago
parent bfd730f3d7
commit 18adee11a5

@ -64,7 +64,7 @@ type clientState struct {
type NetworkState struct { type NetworkState struct {
State ipn.State State ipn.State
NetworkMap *controlclient.NetworkMap NetworkMap *controlclient.NetworkMap
HasInternet bool LostInternet bool
} }
// UIEvent is an event flowing from the UI to the backend. // UIEvent is an event flowing from the UI to the backend.
@ -257,7 +257,7 @@ func (a *App) runBackend() error {
} }
} }
case <-onConnectivityChange: case <-onConnectivityChange:
state.HasInternet = connected.Load().(bool) state.LostInternet = !connected.Load().(bool)
if b != nil { if b != nil {
b.LinkChange() b.LinkChange()
} }

@ -224,7 +224,7 @@ func (ui *UI) layout(gtx layout.Context, sysIns system.Insets, state *clientStat
} }
return ui.layoutSignIn(gtx) return ui.layoutSignIn(gtx)
case 4: case 4:
if needsLogin || state.net.HasInternet { if needsLogin || !state.net.LostInternet {
return D{} return D{}
} }
return ui.layoutDisconnected(gtx) return ui.layoutDisconnected(gtx)

Loading…
Cancel
Save