X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bsignup%2F%2Bregister%2Fcustom-stepper.component.ts;h=3b7ba40e8ae6ce9af57c7ca8bdde2f6325ffd042;hb=a70bf3bd3337406704af5907a015ba385df0483d;hp=2ae40f3a9696a9b8d4f928f4b1ad32c2b377797e;hpb=b247a132709eb212fef4f77c4912dc0ec108f36b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+signup/+register/custom-stepper.component.ts b/client/src/app/+signup/+register/custom-stepper.component.ts index 2ae40f3a9..3b7ba40e8 100644 --- a/client/src/app/+signup/+register/custom-stepper.component.ts +++ b/client/src/app/+signup/+register/custom-stepper.component.ts @@ -1,5 +1,5 @@ -import { Component } from '@angular/core' import { CdkStep, CdkStepper } from '@angular/cdk/stepper' +import { Component } from '@angular/core' @Component({ selector: 'my-custom-stepper', @@ -14,6 +14,13 @@ export class CustomStepperComponent extends CdkStepper { } isCompleted (step: CdkStep) { - return step.stepControl && step.stepControl.dirty && step.stepControl.valid + return step.stepControl?.dirty && step.stepControl.valid + } + + isAccessible (index: number) { + const stepsCompletedMap = this.steps.map(step => this.isCompleted(step)) + return index === 0 + ? true + : stepsCompletedMap[index - 1] } }