@resolveio/client-lib-core 1.1.11 → 1.1.13

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.
@@ -4577,7 +4577,6 @@ class NavbarMainComponent extends BaseComponent {
4577
4577
  }
4578
4578
  async logout() {
4579
4579
  this._app.isLoggingOut.next(true);
4580
- this._services._router.navigateByUrl('/home');
4581
4580
  await this._services._account.logOut();
4582
4581
  this._app.isLoggingOut.next(false);
4583
4582
  }
@@ -7411,35 +7410,44 @@ class HomeComponent extends BaseComponent {
7411
7410
  ]
7412
7411
  };
7413
7412
  this.selectedSolution = 'Asset';
7414
- this.subscription$ = [];
7413
+ this.loggingOut$ = null;
7414
+ this.subscription$ = null;
7415
7415
  }
7416
7416
  ngOnInit() {
7417
7417
  this._services._app.setNavbarModuleData(this.menuData);
7418
- if (!this._app.isLoggingOut.getValue()) {
7419
- if (this._services._account.getUser()) {
7420
- if (this._services._account.getUser().settings && this._services._account.getUser().settings.opening_route && this._services._account.getUser().settings.opening_route !== '/home') {
7421
- this._services._router.navigateByUrl(this._services._account.getUser().settings.opening_route);
7422
- }
7423
- else if (this._services._router.url !== '/home') {
7424
- this._services._router.navigateByUrl('/home');
7425
- }
7426
- }
7427
- else {
7428
- this.subscription$.push(this._services._account.user.subscribe(user => {
7429
- if (user && user.settings && user.settings.opening_route && user.settings.opening_route !== '/home') {
7430
- this._services._router.navigateByUrl(user.settings.opening_route);
7418
+ this.loggingOut$ = this._app.isLoggingOut.subscribe(isLoggingOut => {
7419
+ if (!this._app.isLoggingOut.getValue()) {
7420
+ if (this._services._account.getUser()) {
7421
+ if (this._services._account.getUser().settings && this._services._account.getUser().settings.opening_route && this._services._account.getUser().settings.opening_route !== '/home') {
7422
+ this._services._router.navigateByUrl(this._services._account.getUser().settings.opening_route);
7431
7423
  }
7432
7424
  else if (this._services._router.url !== '/home') {
7433
7425
  this._services._router.navigateByUrl('/home');
7434
7426
  }
7435
- }, () => { }));
7427
+ }
7428
+ else {
7429
+ if (this.subscription$) {
7430
+ this.subscription$.unsubscribe();
7431
+ }
7432
+ this.subscription$ = this._services._account.user.subscribe(user => {
7433
+ if (user && user.settings && user.settings.opening_route && user.settings.opening_route !== '/home') {
7434
+ this._services._router.navigateByUrl(user.settings.opening_route);
7435
+ }
7436
+ else if (this._services._router.url !== '/home') {
7437
+ this._services._router.navigateByUrl('/home');
7438
+ }
7439
+ }, () => { });
7440
+ }
7436
7441
  }
7437
- }
7442
+ });
7438
7443
  }
7439
7444
  ngOnDestroy() {
7440
- this.subscription$.forEach(sub => {
7441
- sub.unsubscribe();
7442
- });
7445
+ if (this.subscription$) {
7446
+ this.subscription$.unsubscribe();
7447
+ }
7448
+ if (this.loggingOut$) {
7449
+ this.loggingOut$.unsubscribe();
7450
+ }
7443
7451
  }
7444
7452
  }
7445
7453
  HomeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: HomeComponent, deps: [{ token: i1$3.ActivatedRoute }, { token: AuthService }, { token: ProviderService }, { token: i4.HttpClient }, { token: CoreService }], target: i0.ɵɵFactoryTarget.Component });