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:
parent
9e3dfaa400
commit
d5de435f06
|
@ -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>
|
||||
|
|
|
@ -13,7 +13,7 @@ class HaPushNotificationsRow extends LitElement {
|
|||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
const platformLoaded = isComponentLoaded(this.hass, "notify.html5");
|
||||
const platformLoaded = isComponentLoaded(this.hass, "html5.notify");
|
||||
let descriptionKey:
|
||||
| "error_use_https"
|
||||
| "error_load_platform"
|
||||
|
|
Loading…
Reference in New Issue