Skip to content

Commit

Permalink
fix(package): select the appropriate tab when forgot password action …
Browse files Browse the repository at this point in the history
…is requested #121
  • Loading branch information
AnthonyNahas committed Sep 7, 2018
1 parent f151188 commit f998cc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/module/components/auth/auth.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<button mat-button
class="space-top"
[color]="color"
(click)="passwordResetWished = true">
(click)="createForgotPasswordTab()">
Forgot Password?
</button>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/module/components/auth/auth.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AuthComponent implements OnInit, OnDestroy {
onError: any;

authProvider = AuthProvider;
passwordResetWished: any;
passwordResetWished: boolean;

public signInFormGroup: FormGroup;
public signUpFormGroup: FormGroup;
Expand Down Expand Up @@ -104,6 +104,11 @@ export class AuthComponent implements OnInit, OnDestroy {
return this.authenticationError ? 'warn' : 'primary';
}

public createForgotPasswordTab() {
this.passwordResetWished = true;
setTimeout(() => this.tabIndex = 0, 100);
}

public openLegalityDialog(authProvider?: AuthProvider) {
if (this.tosUrl || this.privacyPolicyUrl) {
const params: LegalityDialogParams = {
Expand Down Expand Up @@ -140,7 +145,6 @@ export class AuthComponent implements OnInit, OnDestroy {


public resetPassword() {
console.log('PasswordResetEmail sent');
this.authProcess.resetPassword(this.resetPasswordEmailFormControl.value)
.then(() => this.passReset = true);
}
Expand Down

0 comments on commit f998cc4

Please sign in to comment.