From 031658eef402b569ff4fb5fc2b073406e003c6af Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 2 Jan 2025 15:53:57 +0100 Subject: [PATCH] =?UTF-8?q?Match=20UI=20with=20core=20and=20don't=20allow?= =?UTF-8?q?=20restore=20config=20without=20db=20and=20vice=20=E2=80=A6=20(?= =?UTF-8?q?#23553)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match UI with core and dont allow restore config without db and vice versa --- .../backup/components/ha-backup-data-picker.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/panels/config/backup/components/ha-backup-data-picker.ts b/src/panels/config/backup/components/ha-backup-data-picker.ts index ac476bb2d5..fbb944322b 100644 --- a/src/panels/config/backup/components/ha-backup-data-picker.ts +++ b/src/panels/config/backup/components/ha-backup-data-picker.ts @@ -77,17 +77,11 @@ export class HaBackupDataPicker extends LitElement { if (data.homeassistant_included) { items.push({ - label: "Settings", + label: `Settings${data.database_included ? " and history" : ""}`, id: "config", version: data.homeassistant_version, }); } - if (data.database_included) { - items.push({ - label: "History", - id: "database", - }); - } items.push( ...data.folders.map((folder) => ({ label: this._localizeFolder(folder), @@ -132,9 +126,6 @@ export class HaBackupDataPicker extends LitElement { if (value.homeassistant_included) { homeassistant.push("config"); } - if (value.database_included) { - homeassistant.push("database"); - } const folders = value.folders; homeassistant.push(...folders); @@ -151,7 +142,9 @@ export class HaBackupDataPicker extends LitElement { (selectedItems: SelectedItems, data: BackupData): BackupData => ({ homeassistant_version: data.homeassistant_version, homeassistant_included: selectedItems.homeassistant.includes("config"), - database_included: selectedItems.homeassistant.includes("database"), + database_included: + data.database_included && + selectedItems.homeassistant.includes("config"), addons: data.addons.filter((addon) => selectedItems.addons.includes(addon.slug) ),