monkey-front-core 0.0.198 → 0.0.201

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.
@@ -4683,19 +4683,28 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
4683
4683
  }
4684
4684
  async handle(request, next) {
4685
4685
  const { url } = request;
4686
+ console.log('====== 1');
4686
4687
  if (this.authService.isTokenMandatory(url)) {
4688
+ console.log('====== 2');
4687
4689
  try {
4688
- const config = await this.config
4690
+ console.log('====== 3');
4691
+ const x = await this.config
4689
4692
  .config()
4690
- .pipe(take(1))
4693
+ .pipe(first((val) => {
4694
+ console.log('====== 4');
4695
+ console.log(val);
4696
+ return !!val && JSON.stringify(val) !== '{}';
4697
+ }))
4691
4698
  .toPromise();
4692
- if (!config) {
4693
- await this.onValidateConfig();
4694
- }
4699
+ console.log('====== 5');
4700
+ console.log(x);
4695
4701
  }
4696
- catch (error) {
4702
+ catch (e) {
4703
+ console.log('====== 6');
4704
+ console.log(e);
4697
4705
  // not to do
4698
4706
  }
4707
+ console.log('====== 7');
4699
4708
  }
4700
4709
  return this.authService
4701
4710
  .getRequestWithHeadersOb(request)
@@ -4712,26 +4721,6 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
4712
4721
  }))
4713
4722
  .toPromise();
4714
4723
  }
4715
- onValidateConfig() {
4716
- return new Promise((resolve) => {
4717
- let count = 0;
4718
- const interval = setInterval(async () => {
4719
- count += 1;
4720
- if (count > 20) {
4721
- clearInterval(interval);
4722
- resolve(null);
4723
- }
4724
- const config = await this.config
4725
- .config()
4726
- .pipe(take(1))
4727
- .toPromise();
4728
- if (config) {
4729
- clearInterval(interval);
4730
- resolve(null);
4731
- }
4732
- }, 200);
4733
- });
4734
- }
4735
4724
  intercept(request, next) {
4736
4725
  return from(this.handle(request, next));
4737
4726
  }