cmd/tailscale/main: apply custom control server on first start (#156)

Currently the custom control server is not applied on start. To remedy
this, check the stored preference and if they differ issue an event to
switch to the correct backend server.

Updates: tailscale/tailscale#17470

Signed-off-by: Moritz Poldrack <git@moritz.sh>
pull/168/head
Moritz Poldrack 10 months ago committed by GitHub
parent f9310e7a1f
commit e90f39a58c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1302,6 +1302,11 @@ func (a *App) processUIEvents(w *app.Window, events []UIEvent, act jni.Object, s
a.signOut()
requestBackend(e)
case ConnectEvent:
if srv, _ := a.store.ReadString(customLoginServerPrefKey, ""); srv != state.backend.Prefs.ControlURL {
requestBackend(SetLoginServerEvent{URL: srv})
// wait a moment for the backend to restart
<-time.After(200 * time.Millisecond)
}
requestBackend(e)
case RouteAllEvent:
requestBackend(e)

Loading…
Cancel
Save