Skip to content

Commit

Permalink
fix(component): correctly reset captcha during ngOnDestroy
Browse files Browse the repository at this point in the history
do not try to access captcha value when the component is being destroyed; fixes #12
  • Loading branch information
DethAriel committed Feb 2, 2017
1 parent 1c3743f commit b31d57f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recaptcha/recaptcha.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class RecaptchaComponent implements AfterViewInit, OnDestroy {
public ngOnDestroy() {
// reset the captcha to ensure it does not leave anything behind
// after the component is no longer needed
this.reset();
if (this.widget != null) {
this.grecaptcha.reset(this.widget);
}
this.subscription.unsubscribe();
}

Expand Down

0 comments on commit b31d57f

Please sign in to comment.