Backup onboarding: Show close button when welcome is skipped (#23567)

This commit is contained in:
Bram Kragten 2025-01-03 11:29:03 +01:00 committed by GitHub
parent 3ff5b832bc
commit cfbcb74ac2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
public showDialog(params: BackupOnboardingDialogParams): void {
this._params = params;
this._step = params.skipWelcome ? STEPS[1] : STEPS[0];
this._step = this._firstStep;
this._config = RECOMMENDED_CONFIG;
const agents: string[] = [];
@ -129,6 +129,10 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
this._params = undefined;
}
private get _firstStep(): Step {
return this._params?.skipWelcome ? STEPS[1] : STEPS[0];
}
private async _done() {
if (!this._config) {
return;
@ -187,7 +191,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
}
const isLastStep = this._step === STEPS[STEPS.length - 1];
const isFirstStep = this._step === STEPS[0];
const isFirstStep = this._step === this._firstStep;
return html`
<ha-md-dialog disable-cancel-action open @closed=${this.closeDialog}>