From 64714c64c7fe6a7e8559e3759d9d6e3e4e6c06e3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 17 Dec 2018 10:08:23 +0100 Subject: [PATCH] Fix notifications drawer (#2344) --- .../notifications/hui-notifications-button.js | 4 ++-- src/panels/lovelace/hui-root.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/panels/lovelace/components/notifications/hui-notifications-button.js b/src/panels/lovelace/components/notifications/hui-notifications-button.js index f0a147664f..ddd8cc8ad6 100644 --- a/src/panels/lovelace/components/notifications/hui-notifications-button.js +++ b/src/panels/lovelace/components/notifications/hui-notifications-button.js @@ -46,7 +46,7 @@ export class HuiNotificationsButton extends EventsMixin(PolymerElement) { static get properties() { return { - notificationsOpen: { + open: { type: Boolean, notify: true, }, @@ -58,7 +58,7 @@ export class HuiNotificationsButton extends EventsMixin(PolymerElement) { } _clicked() { - this.notificationsOpen = true; + this.open = true; } _hasNotifications(notifications) { diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index d81b8b7f5c..ca4fa8c9b9 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -68,7 +68,7 @@ class HUIRoot extends hassLocalizeLitMixin(LitElement) { public route?: { path: string; prefix: string }; private _routeData?: { view: string }; private _curView?: number | "hass-unused-entities"; - private notificationsOpen?: boolean; + private _notificationsOpen: boolean; private _persistentNotifications?: Notification[]; private _haStyle?: DocumentFragment; private _viewCache?: { [viewId: string]: HUIView }; @@ -86,13 +86,14 @@ class HUIRoot extends hassLocalizeLitMixin(LitElement) { route: {}, _routeData: {}, _curView: {}, - notificationsOpen: {}, + _notificationsOpen: {}, _persistentNotifications: {}, }; } constructor() { super(); + this._notificationsOpen = false; // The view can trigger a re-render when it knows that certain // web components have been loaded. this._debouncedConfigChanged = debounce( @@ -127,7 +128,7 @@ class HUIRoot extends hassLocalizeLitMixin(LitElement) { @@ -188,7 +189,8 @@ class HUIRoot extends hassLocalizeLitMixin(LitElement) {
${this.config.title || "Home Assistant"}