@resolveio/client-lib-core 1.1.12 → 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.
@@ -1557,13 +1557,13 @@ class AccountManagerService {
1557
1557
  }
1558
1558
  logOut() {
1559
1559
  return new Promise((resolve, reject) => {
1560
+ this._router.navigateByUrl('/home');
1560
1561
  setTimeout(() => {
1561
1562
  this.user.next(null);
1562
1563
  this._token.removeToken('refreshToken');
1563
1564
  this._token.removeToken('accessToken');
1564
1565
  this._offline.removeUser();
1565
1566
  this.closeSocket();
1566
- this._router.navigateByUrl('/home');
1567
1567
  resolve(true);
1568
1568
  }, 500);
1569
1569
  });
@@ -7410,35 +7410,44 @@ class HomeComponent extends BaseComponent {
7410
7410
  ]
7411
7411
  };
7412
7412
  this.selectedSolution = 'Asset';
7413
- this.subscription$ = [];
7413
+ this.loggingOut$ = null;
7414
+ this.subscription$ = null;
7414
7415
  }
7415
7416
  ngOnInit() {
7416
7417
  this._services._app.setNavbarModuleData(this.menuData);
7417
- if (!this._app.isLoggingOut.getValue()) {
7418
- if (this._services._account.getUser()) {
7419
- if (this._services._account.getUser().settings && this._services._account.getUser().settings.opening_route && this._services._account.getUser().settings.opening_route !== '/home') {
7420
- this._services._router.navigateByUrl(this._services._account.getUser().settings.opening_route);
7421
- }
7422
- else if (this._services._router.url !== '/home') {
7423
- this._services._router.navigateByUrl('/home');
7424
- }
7425
- }
7426
- else {
7427
- this.subscription$.push(this._services._account.user.subscribe(user => {
7428
- if (user && user.settings && user.settings.opening_route && user.settings.opening_route !== '/home') {
7429
- 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);
7430
7423
  }
7431
7424
  else if (this._services._router.url !== '/home') {
7432
7425
  this._services._router.navigateByUrl('/home');
7433
7426
  }
7434
- }, () => { }));
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
+ }
7435
7441
  }
7436
- }
7442
+ });
7437
7443
  }
7438
7444
  ngOnDestroy() {
7439
- this.subscription$.forEach(sub => {
7440
- sub.unsubscribe();
7441
- });
7445
+ if (this.subscription$) {
7446
+ this.subscription$.unsubscribe();
7447
+ }
7448
+ if (this.loggingOut$) {
7449
+ this.loggingOut$.unsubscribe();
7450
+ }
7442
7451
  }
7443
7452
  }
7444
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 });