@osovitny/anatoly 2.14.45 → 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.
- package/esm2020/lib/core/services/appcontext.service.mjs +5 -8
- package/esm2020/lib/ui/forms/contact-us/contact-us.mjs +13 -13
- package/fesm2015/osovitny-anatoly.mjs +16 -19
- package/fesm2015/osovitny-anatoly.mjs.map +1 -1
- package/fesm2020/osovitny-anatoly.mjs +16 -19
- package/fesm2020/osovitny-anatoly.mjs.map +1 -1
- package/lib/core/services/appcontext.service.d.ts +0 -1
- package/lib/ui/forms/contact-us/contact-us.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1398,8 +1398,8 @@ class AppContextService extends BaseApiService {
|
|
|
1398
1398
|
if (lr) {
|
|
1399
1399
|
let now = new Date();
|
|
1400
1400
|
let lastRequested = new Date(context.lastRequested);
|
|
1401
|
-
let
|
|
1402
|
-
if (
|
|
1401
|
+
let in3Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 3, 0, 0);
|
|
1402
|
+
if (in3Mins.getTime() < now.getTime()) {
|
|
1403
1403
|
shouldBeUpdated = true;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
@@ -1450,15 +1450,12 @@ class AppContextService extends BaseApiService {
|
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
1452
|
updateCurrent(success = null) {
|
|
1453
|
-
this.
|
|
1453
|
+
this.clearCurrent();
|
|
1454
|
+
this.getLatestCurrent(success);
|
|
1454
1455
|
}
|
|
1455
1456
|
clearCurrent() {
|
|
1456
1457
|
this.sessionStorage.remove(this.storageKeyName);
|
|
1457
1458
|
}
|
|
1458
|
-
refreshCurrent() {
|
|
1459
|
-
this.clearCurrent();
|
|
1460
|
-
this.updateCurrent();
|
|
1461
|
-
}
|
|
1462
1459
|
//Properties
|
|
1463
1460
|
get current() {
|
|
1464
1461
|
this.updateCurrentIfExpired();
|
|
@@ -3506,7 +3503,9 @@ class ContactUsForm extends BaseEditComponent {
|
|
|
3506
3503
|
}
|
|
3507
3504
|
ngOnInit() {
|
|
3508
3505
|
this.createFormGroup();
|
|
3509
|
-
this.
|
|
3506
|
+
this.appContext.getCurrent(context => {
|
|
3507
|
+
this.setContext(context);
|
|
3508
|
+
});
|
|
3510
3509
|
}
|
|
3511
3510
|
createFormGroup() {
|
|
3512
3511
|
this.formGroup = this.fb.group({
|
|
@@ -3518,17 +3517,15 @@ class ContactUsForm extends BaseEditComponent {
|
|
|
3518
3517
|
message: new FormControl('', [Validators.required])
|
|
3519
3518
|
});
|
|
3520
3519
|
}
|
|
3521
|
-
|
|
3522
|
-
this.
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
}
|
|
3531
|
-
}, 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
|
+
}
|
|
3532
3529
|
}
|
|
3533
3530
|
isValid() {
|
|
3534
3531
|
return this.formGroup.valid;
|