Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading