diff --git a/src/components/ha-analytics.ts b/src/components/ha-analytics.ts index dc74af02e0..7915c38d5a 100644 --- a/src/components/ha-analytics.ts +++ b/src/components/ha-analytics.ts @@ -1,5 +1,5 @@ import type { CSSResultGroup, TemplateResult } from "lit"; -import { css, html, LitElement } from "lit"; +import { css, html, LitElement, nothing } from "lit"; import { customElement, property } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import type { LocalizeFunc } from "../common/translations/localize"; @@ -73,14 +73,18 @@ export class HaAnalytics extends LitElement { .checked=${this.analytics?.preferences[preference]} .preference=${preference} name=${preference} - ?disabled=${baseEnabled} > - - ${this.localize( - `ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled` - )} - + ${baseEnabled + ? nothing + : html` + ${this.localize( + `ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled` + )} + `} `