@osovitny/anatoly 2.14.46 → 2.14.48

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.
@@ -1422,11 +1422,7 @@ class AppContextService extends BaseApiService {
1422
1422
  this.subscription.unsubscribe();
1423
1423
  this.subscription = null;
1424
1424
  }
1425
- //Public
1426
- getLatestCurrent(success = null) {
1427
- this.getCurrent(success, false);
1428
- }
1429
- getCurrent(success = null, getCachedIfExist = true) {
1425
+ getCurrentPrivate(success = null, getCachedIfExist = true) {
1430
1426
  if (getCachedIfExist) {
1431
1427
  let context = this.getCurrentFromSession();
1432
1428
  if (context != null) {
@@ -1449,6 +1445,13 @@ class AppContextService extends BaseApiService {
1449
1445
  }
1450
1446
  });
1451
1447
  }
1448
+ //Public
1449
+ getLatestCurrent(success = null) {
1450
+ this.getCurrentPrivate(success, false);
1451
+ }
1452
+ getCurrent(success = null) {
1453
+ this.getCurrentPrivate(success, true);
1454
+ }
1452
1455
  updateCurrent(success = null) {
1453
1456
  this.clearCurrent();
1454
1457
  this.getLatestCurrent(success);
@@ -3503,7 +3506,9 @@ class ContactUsForm extends BaseEditComponent {
3503
3506
  }
3504
3507
  ngOnInit() {
3505
3508
  this.createFormGroup();
3506
- this.init();
3509
+ this.appContext.getCurrent(context => {
3510
+ this.setContext(context);
3511
+ });
3507
3512
  }
3508
3513
  createFormGroup() {
3509
3514
  this.formGroup = this.fb.group({
@@ -3515,17 +3520,15 @@ class ContactUsForm extends BaseEditComponent {
3515
3520
  message: new FormControl('', [Validators.required])
3516
3521
  });
3517
3522
  }
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);
3523
+ setContext(context) {
3524
+ this.isUserSignedIn = context.isUserSignedIn;
3525
+ this.siteKey = context.reCaptchaSiteKey;
3526
+ this.selectedTopic = this.topicList[3].value;
3527
+ this.setFormValue('topic', this.selectedTopic);
3528
+ if (this.isUserSignedIn) {
3529
+ this.setFormValue('name', context.user.displayNameOrFullName);
3530
+ this.setFormValue('email', context.user.email);
3531
+ }
3529
3532
  }
3530
3533
  isValid() {
3531
3534
  return this.formGroup.valid;