diff --git a/src/panels/config/automation/action/ha-automation-action.ts b/src/panels/config/automation/action/ha-automation-action.ts index 67270fd89a..f23cfaf414 100644 --- a/src/panels/config/automation/action/ha-automation-action.ts +++ b/src/panels/config/automation/action/ha-automation-action.ts @@ -6,7 +6,6 @@ import { customElement, property, queryAll, state } from "lit/decorators"; import { repeat } from "lit/directives/repeat"; import { storage } from "../../../../common/decorators/storage"; import { fireEvent } from "../../../../common/dom/fire_event"; -import { listenMediaQuery } from "../../../../common/dom/media_query"; import { nextRender } from "../../../../common/util/render-status"; import "../../../../components/ha-button"; import "../../../../components/ha-sortable"; @@ -46,8 +45,6 @@ export default class HaAutomationAction extends LitElement { @property({ type: Boolean, attribute: "sidebar" }) public optionsInSidebar = false; - @state() private _showReorder = false; - @state() private _rowSortSelected?: number; @state() @@ -68,27 +65,12 @@ export default class HaAutomationAction extends LitElement { private _actionKeys = new WeakMap(); - private _unsubMql?: () => void; - - public connectedCallback() { - super.connectedCallback(); - this._unsubMql = listenMediaQuery("(min-width: 600px)", (matches) => { - this._showReorder = matches; - }); - } - - public disconnectedCallback() { - super.disconnectedCallback(); - this._unsubMql?.(); - this._unsubMql = undefined; - } - protected render() { return html` - ${this._showReorder && !this.disabled + ${!this.disabled ? html`
(); - private _unsubMql?: () => void; - - public connectedCallback() { - super.connectedCallback(); - this._unsubMql = listenMediaQuery("(min-width: 600px)", (matches) => { - this._showReorder = matches; - }); - } - - public disconnectedCallback() { - super.disconnectedCallback(); - this._unsubMql?.(); - this._unsubMql = undefined; - } - protected updated(changedProperties: PropertyValues) { if (!changedProperties.has("conditions")) { return; @@ -165,7 +147,7 @@ export default class HaAutomationCondition extends LitElement { - ${this._showReorder && !this.disabled + ${!this.disabled ? html`
(); - private _unsubMql?: () => void; - - public connectedCallback() { - super.connectedCallback(); - this._unsubMql = listenMediaQuery("(min-width: 600px)", (matches) => { - this._showReorder = matches; - }); - } - - public disconnectedCallback() { - super.disconnectedCallback(); - this._unsubMql?.(); - this._unsubMql = undefined; - } - protected render() { return html` - ${this._showReorder && !this.disabled + ${!this.disabled ? html`
(); - private _unsubMql?: () => void; - - public connectedCallback() { - super.connectedCallback(); - this._unsubMql = listenMediaQuery("(min-width: 600px)", (matches) => { - this._showReorder = matches; - }); - } - - public disconnectedCallback() { - super.disconnectedCallback(); - this._unsubMql?.(); - this._unsubMql = undefined; - } - protected render() { return html` - ${this._showReorder && !this.disabled + ${!this.disabled ? html`