Fix refreshing cloud prefs after changing Google prefs (#3240)

This commit is contained in:
Paulus Schoutsen 2019-06-02 13:37:55 -07:00 committed by GitHub
parent 1eee186e79
commit ffd272d3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -249,7 +249,7 @@ class CloudGoogleAssistant extends LitElement {
// Cache parent because by the time popstate happens,
// this element is detached
const parent = this.parentElement!;
this.addEventListener(
window.addEventListener(
"popstate",
() => fireEvent(parent, "ha-refresh-cloud-status"),
{ once: true }

View File

@ -6,6 +6,13 @@ import { CloudStatus, fetchCloudStatus } from "../../data/cloud";
import { listenMediaQuery } from "../../common/dom/media_query";
import { HassRouterPage, RouterOptions } from "../../layouts/hass-router-page";
declare global {
// for fire event
interface HASSDomEvents {
"ha-refresh-cloud-status": undefined;
}
}
@customElement("ha-panel-config")
class HaPanelConfig extends HassRouterPage {
@property() public hass!: HomeAssistant;

View File

@ -30,7 +30,6 @@ declare global {
"hass-logout": undefined;
"iron-resize": undefined;
"config-refresh": undefined;
"ha-refresh-cloud-status": undefined;
"hass-api-called": {
success: boolean;
response: unknown;