@osovitny/anatoly 2.14.46 → 2.14.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3503,7 +3503,9 @@ class ContactUsForm extends BaseEditComponent {
3503
3503
  }
3504
3504
  ngOnInit() {
3505
3505
  this.createFormGroup();
3506
- this.init();
3506
+ this.appContext.getCurrent(context => {
3507
+ this.setContext(context);
3508
+ });
3507
3509
  }
3508
3510
  createFormGroup() {
3509
3511
  this.formGroup = this.fb.group({
@@ -3515,17 +3517,15 @@ class ContactUsForm extends BaseEditComponent {
3515
3517
  message: new FormControl('', [Validators.required])
3516
3518
  });
3517
3519
  }
3518
- init() {
3519
- this.appContext.getCurrent(context => {
3520
- this.isUserSignedIn = context.isUserSignedIn;
3521
- this.siteKey = context.reCaptchaSiteKey;
3522
- this.selectedTopic = this.topicList[3].value;
3523
- this.setFormValue('topic', this.selectedTopic);
3524
- if (this.isUserSignedIn) {
3525
- this.setFormValue('name', context.user.displayNameOrFullName);
3526
- this.setFormValue('email', context.user.email);
3527
- }
3528
- }, false);
3520
+ setContext(context) {
3521
+ this.isUserSignedIn = context.isUserSignedIn;
3522
+ this.siteKey = context.reCaptchaSiteKey;
3523
+ this.selectedTopic = this.topicList[3].value;
3524
+ this.setFormValue('topic', this.selectedTopic);
3525
+ if (this.isUserSignedIn) {
3526
+ this.setFormValue('name', context.user.displayNameOrFullName);
3527
+ this.setFormValue('email', context.user.email);
3528
+ }
3529
3529
  }
3530
3530
  isValid() {
3531
3531
  return this.formGroup.valid;