From 679f97afb3538691d4e48f0409153194d4151757 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 31 Aug 2020 12:07:08 +0200 Subject: [PATCH] cmd/tailscale: don't show toggle when not authenticated Also, change the login screen tile to say "Tailscale", not the redundant "Needs authentication". Updates tailscale/tailscale#608 Signed-off-by: Elias Naur --- cmd/tailscale/ui.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/tailscale/ui.go b/cmd/tailscale/ui.go index af7e804..2fdec5c 100644 --- a/cmd/tailscale/ui.go +++ b/cmd/tailscale/ui.go @@ -687,6 +687,9 @@ func (ui *UI) layoutTop(gtx layout.Context, sysIns system.Insets, state *Backend return layout.Flex{Alignment: layout.Middle}.Layout(gtx, layout.Rigid(func(gtx C) D { return in.Layout(gtx, func(gtx C) D { + if state.State <= ipn.NeedsLogin { + return D{} + } sw := material.Switch(ui.theme, &ui.enabled) sw.Color.Enabled = rgb(white) if state.State < ipn.Stopped { @@ -731,7 +734,7 @@ func statusString(state ipn.State) string { case ipn.NeedsMachineAuth: return "Awaiting Approval" case ipn.NeedsLogin: - return "Needs Authentication" + return "Tailscale" default: return "Loading..." }