diff --git a/orbit/changes/21948-self-service-checked b/orbit/changes/21948-self-service-checked new file mode 100644 index 000000000000..c8a10876f967 --- /dev/null +++ b/orbit/changes/21948-self-service-checked @@ -0,0 +1 @@ +* Fixed cases where self-service menu item temporarily disappeared from Fleet Desktop menu when it should have stayed visible. diff --git a/orbit/cmd/desktop/desktop.go b/orbit/cmd/desktop/desktop.go index da42144b1a76..6f1531e06599 100644 --- a/orbit/cmd/desktop/desktop.go +++ b/orbit/cmd/desktop/desktop.go @@ -248,16 +248,23 @@ func main() { for { refetchToken() - _, err := client.DesktopSummary(tokenReader.GetCached()) + summary, err := client.DesktopSummary(tokenReader.GetCached()) if err == nil || errors.Is(err, service.ErrMissingLicense) { log.Debug().Msg("enabling tray items") myDeviceItem.SetTitle("My device") myDeviceItem.Enable() transparencyItem.Enable() + // Hide Self-Service for Free tier - selfServiceItem.Disable() - selfServiceItem.Hide() + if errors.Is(err, service.ErrMissingLicense) || (summary.SelfService != nil && !*summary.SelfService) { + selfServiceItem.Disable() + selfServiceItem.Hide() + } else { + selfServiceItem.Enable() + selfServiceItem.Show() + } + return }