Fix restoring backup during onboarding (#23569)

pull/23570/head
Bram Kragten 2025-01-03 15:26:50 +01:00 committed by GitHub
parent 71e10d5d8e
commit 4ffec51a5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -179,8 +179,8 @@ class HassioBackupDialog
} }
private async _restoreClicked() { private async _restoreClicked() {
this._restoringBackup = true;
const backupDetails = this._backupContent.backupDetails(); const backupDetails = this._backupContent.backupDetails();
this._restoringBackup = true;
const supervisor = this._dialogParams?.supervisor; const supervisor = this._dialogParams?.supervisor;
if (supervisor !== undefined && supervisor.info.state !== "running") { if (supervisor !== undefined && supervisor.info.state !== "running") {
@ -196,12 +196,12 @@ class HassioBackupDialog
if ( if (
!(await showConfirmationDialog(this, { !(await showConfirmationDialog(this, {
title: this._localize( title: this._localize(
this._backupContent.backupType === "full" this._backup!.type === "full"
? "confirm_restore_full_backup_title" ? "confirm_restore_full_backup_title"
: "confirm_restore_partial_backup_title" : "confirm_restore_partial_backup_title"
), ),
text: this._localize( text: this._localize(
this._backupContent.backupType === "full" this._backup!.type === "full"
? "confirm_restore_full_backup_text" ? "confirm_restore_full_backup_text"
: "confirm_restore_partial_backup_text" : "confirm_restore_partial_backup_text"
), ),
@ -216,9 +216,9 @@ class HassioBackupDialog
try { try {
await restoreBackup( await restoreBackup(
this.hass, this.hass,
this._backupContent.backupType, this._backup!.type,
this._backup!.slug, this._backup!.slug,
backupDetails, { ...backupDetails, background: this._dialogParams?.onboarding },
!!this.hass && atLeastVersion(this.hass.config.version, 2021, 9) !!this.hass && atLeastVersion(this.hass.config.version, 2021, 9)
); );

View File

@ -46,6 +46,7 @@ export interface HassioFullBackupCreateParams {
name: string; name: string;
password?: string; password?: string;
confirm_password?: string; confirm_password?: string;
background?: boolean;
} }
export interface HassioPartialBackupCreateParams export interface HassioPartialBackupCreateParams
extends HassioFullBackupCreateParams { extends HassioFullBackupCreateParams {