mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-10 11:30:01 +00:00
Fix html5 notification toggle (#20028)
* Fix html5 notification toggle * Update src/components/ha-push-notifications-toggle.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl> * fix lint --------- Co-authored-by: alexyao2015 <alexyao2015@users.noreply.github.com> Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
@@ -17,7 +17,7 @@ export const pushSupported =
|
||||
class HaPushNotificationsToggle extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@state() private _disabled: boolean = false;
|
||||
@property({ type: Boolean }) public disabled!: boolean;
|
||||
|
||||
@state() private _pushChecked: boolean =
|
||||
"Notification" in window && Notification.permission === "granted";
|
||||
@@ -27,7 +27,7 @@ class HaPushNotificationsToggle extends LitElement {
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
<ha-switch
|
||||
.disabled=${this._disabled || this._loading}
|
||||
.disabled=${this.disabled || this._loading}
|
||||
.checked=${this._pushChecked}
|
||||
@change=${this._handlePushChange}
|
||||
></ha-switch>
|
||||
|
||||
Reference in New Issue
Block a user