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

Rename BaseNavigationMode.checkReset to ensureCanReset #206

Merged
merged 1 commit into from Apr 16, 2019

Conversation

earshinov
Copy link
Contributor

@earshinov earshinov commented Apr 15, 2019

  • Rename checkReset to ensureCanReset
  • Use void return value instead of boolean

An error is indicated by an exception.

See discussion: #166 (comment)

… return value instead of `boolean`. An error is indicated by an exception.
return false;
}
protected ensureCanReset(): void {
super.ensureCanReset();

// the default step is a completion step and the wizard contains more than one step
const defaultCompletionStep = this.wizardState.getStepAtIndex(this.wizardState.defaultStepIndex) instanceof WizardCompletionStep;
if (defaultCompletionStep && this.wizardState.wizardSteps.length !== 1) {
throw new Error(`The default step index ${this.wizardState.defaultStepIndex} references a completion step`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will need to rethink whether starting inside a completion step is really a reason for an Error.
If we look at #170 it may be a good idea to allow for a wizard to initialize inside a completion step.

@madoar madoar merged commit 593ba80 into madoar:develop Apr 16, 2019
@earshinov earshinov deleted the rename-check-reset branch May 10, 2019 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants