Skip to content

Commit

Permalink
Backup onboarding: Show close button when welcome is skipped (#23567)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Jan 3, 2025
1 parent 3ff5b83 commit cfbcb74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/panels/config/backup/dialogs/dialog-backup-onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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}>
Expand Down

0 comments on commit cfbcb74

Please sign in to comment.