Skip to content

Commit

Permalink
Fix Dashboard Editing (home-assistant#12011)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarnett authored Mar 11, 2022
1 parent 294a69d commit f4e28da
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CoreFrontendUserData } from "../../../../data/frontend";
import {
LovelaceDashboard,
LovelaceDashboardCreateParams,
LovelaceDashboardMutableParams,
} from "../../../../data/lovelace";
import { DEFAULT_PANEL, setDefaultPanel } from "../../../../data/panel";
import { haStyleDialog } from "../../../../resources/styles";
Expand Down Expand Up @@ -40,7 +41,7 @@ export class DialogLovelaceDashboardDetail extends LitElement {
} else {
this._data = {
show_in_sidebar: true,
icon: "",
icon: undefined,
title: "",
require_admin: false,
mode: "storage",
Expand Down Expand Up @@ -264,7 +265,13 @@ export class DialogLovelaceDashboardDetail extends LitElement {
this._submitting = true;
try {
if (this._params!.dashboard) {
await this._params!.updateDashboard(this._data as LovelaceDashboard);
const values: Partial<LovelaceDashboardMutableParams> = {
require_admin: this._data!.require_admin,
show_in_sidebar: this._data!.show_in_sidebar,
icon: this._data!.icon || undefined,
title: this._data!.title,
};
await this._params!.updateDashboard(values);
} else {
await this._params!.createDashboard(
this._data as LovelaceDashboardCreateParams
Expand Down

0 comments on commit f4e28da

Please sign in to comment.