@smartbit4all/ng-client 1.1.11 → 1.1.12

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.
@@ -2289,8 +2289,9 @@ class SmartViewContextService {
2289
2289
  throw new Error('The type of the view and its viewHandler is not the same!');
2290
2290
  }
2291
2291
  view.state = ViewState.Closed;
2292
- this.openedViewUuids.slice(this.openedViewUuids.indexOf(view.uuid), 1);
2293
- this.openedViewData.slice(this.openedViewData.indexOf(view), 1);
2292
+ const index = this.openedViewUuids.indexOf(view.uuid);
2293
+ this.openedViewUuids.slice(index, 1);
2294
+ this.openedViewData.slice(index, 1);
2294
2295
  sessionStorage.removeItem(view.viewName);
2295
2296
  this.updateViewContext({
2296
2297
  updates: [
@@ -2321,19 +2322,16 @@ class SmartViewContextService {
2321
2322
  break;
2322
2323
  }
2323
2324
  });
2324
- // if (this.openedViewData.length !== this.viewContext?.views.length) {
2325
- // const viewDataToClose = this.openedViewData.filter(
2326
- // (viewData: ViewData) =>
2327
- // !this.viewContext?.views
2328
- // .flatMap((viewData: ViewData) => viewData.uuid)
2329
- // .includes(viewData.uuid)
2330
- // );
2331
- // if (viewDataToClose?.length) {
2332
- // viewDataToClose.forEach((viewData: ViewData) => {
2333
- // this.closeView(viewData);
2334
- // });
2335
- // }
2336
- // }
2325
+ if (this.openedViewData.length > this.viewContext.views.length) {
2326
+ const viewDataToClose = this.openedViewData.filter((viewData) => !this.viewContext?.views
2327
+ .flatMap((viewData) => viewData.uuid)
2328
+ .includes(viewData.uuid));
2329
+ if (viewDataToClose?.length) {
2330
+ viewDataToClose.forEach((viewData) => {
2331
+ this.closeView(viewData);
2332
+ });
2333
+ }
2334
+ }
2337
2335
  this.viewContextHasBeenSynced.next();
2338
2336
  }
2339
2337
  getUuidOfPage(pageName) {