cmd/tailscale: assume internet connectivity at startup

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

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

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

Loading…
Cancel
Save