mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Match UI with core and don't allow restore config without db and vice … (#23553)
Match UI with core and dont allow restore config without db and vice versa
This commit is contained in:
parent
fa672ffbba
commit
031658eef4
@ -77,17 +77,11 @@ export class HaBackupDataPicker extends LitElement {
|
|||||||
|
|
||||||
if (data.homeassistant_included) {
|
if (data.homeassistant_included) {
|
||||||
items.push({
|
items.push({
|
||||||
label: "Settings",
|
label: `Settings${data.database_included ? " and history" : ""}`,
|
||||||
id: "config",
|
id: "config",
|
||||||
version: data.homeassistant_version,
|
version: data.homeassistant_version,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (data.database_included) {
|
|
||||||
items.push({
|
|
||||||
label: "History",
|
|
||||||
id: "database",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
items.push(
|
items.push(
|
||||||
...data.folders.map<CheckBoxItem>((folder) => ({
|
...data.folders.map<CheckBoxItem>((folder) => ({
|
||||||
label: this._localizeFolder(folder),
|
label: this._localizeFolder(folder),
|
||||||
@ -132,9 +126,6 @@ export class HaBackupDataPicker extends LitElement {
|
|||||||
if (value.homeassistant_included) {
|
if (value.homeassistant_included) {
|
||||||
homeassistant.push("config");
|
homeassistant.push("config");
|
||||||
}
|
}
|
||||||
if (value.database_included) {
|
|
||||||
homeassistant.push("database");
|
|
||||||
}
|
|
||||||
|
|
||||||
const folders = value.folders;
|
const folders = value.folders;
|
||||||
homeassistant.push(...folders);
|
homeassistant.push(...folders);
|
||||||
@ -151,7 +142,9 @@ export class HaBackupDataPicker extends LitElement {
|
|||||||
(selectedItems: SelectedItems, data: BackupData): BackupData => ({
|
(selectedItems: SelectedItems, data: BackupData): BackupData => ({
|
||||||
homeassistant_version: data.homeassistant_version,
|
homeassistant_version: data.homeassistant_version,
|
||||||
homeassistant_included: selectedItems.homeassistant.includes("config"),
|
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) =>
|
addons: data.addons.filter((addon) =>
|
||||||
selectedItems.addons.includes(addon.slug)
|
selectedItems.addons.includes(addon.slug)
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user