Fix errors

This commit is contained in:
Paul Bottein 2024-10-17 22:01:03 +02:00
parent d24b9b6ced
commit 2518b1a79d
No known key found for this signature in database
4 changed files with 9 additions and 10 deletions

View File

@ -45,6 +45,7 @@ class HcLovelace extends LitElement {
saveConfig: async () => undefined,
deleteConfig: async () => undefined,
setEditMode: () => undefined,
showToast: () => undefined,
};
return html`
<hui-view

View File

@ -131,6 +131,7 @@ class PanelEnergy extends LitElement {
saveConfig: async () => undefined,
deleteConfig: async () => undefined,
setEditMode: () => undefined,
showToast: () => undefined,
};
}

View File

@ -274,7 +274,7 @@ export class HuiCardOptions extends LitElement {
this._cutCard();
break;
case 4:
this._deleteCard(true);
this._deleteCard({ silent: false });
break;
}
}
@ -297,7 +297,7 @@ export class HuiCardOptions extends LitElement {
private _cutCard(): void {
this._copyCard();
this._deleteCard(false);
this._deleteCard({ silent: true });
}
private _copyCard(): void {
@ -395,8 +395,8 @@ export class HuiCardOptions extends LitElement {
});
}
private _deleteCard(confirm: boolean): void {
fireEvent(this, "ll-delete-card", { path: this.path!, confirm });
private _deleteCard({ silent }: { silent: boolean }): void {
fireEvent(this, "ll-delete-card", { path: this.path!, silent });
}
}

View File

@ -23,16 +23,15 @@ import { fetchResources } from "../../data/lovelace/resource";
import { WindowWithPreloads } from "../../data/preloads";
import "../../layouts/hass-error-screen";
import "../../layouts/hass-loading-screen";
import { ShowToastParams } from "../../managers/notification-manager";
import { HomeAssistant, PanelInfo, Route } from "../../types";
import { showToast } from "../../util/toast";
import { loadLovelaceResources } from "./common/load-resources";
import { checkLovelaceConfig } from "./common/check-lovelace-config";
import { loadLovelaceResources } from "./common/load-resources";
import { showSaveDialog } from "./editor/show-save-config-dialog";
import "./hui-root";
import { generateLovelaceDashboardStrategy } from "./strategies/get-strategy";
import { Lovelace } from "./types";
import { fireEvent } from "../../common/dom/fire_event";
import { ShowToastParams } from "../../managers/notification-manager";
(window as any).loadCardHelpers = () => import("./custom-card-helpers");
@ -436,9 +435,7 @@ export class LovelacePanel extends LitElement {
throw err;
}
},
showToast: (params: ShowToastParams) => {
fireEvent(this, "hass-notification", params);
},
showToast: (params: ShowToastParams) => showToast(this, params),
};
}