@smartbit4all/ng-client 1.1.13 → 1.1.14

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.
@@ -2221,7 +2221,7 @@ class SmartViewContextService {
2221
2221
  }
2222
2222
  return this.viewContext;
2223
2223
  }
2224
- openView(view) {
2224
+ async openView(view) {
2225
2225
  let viewHandler = this.viewHandlers.find((handler) => handler.name === view.viewName);
2226
2226
  if (!viewHandler) {
2227
2227
  throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
@@ -2255,7 +2255,7 @@ class SmartViewContextService {
2255
2255
  this.openedViewData.push(view);
2256
2256
  sessionStorage.setItem(view.viewName, view.uuid);
2257
2257
  this.uuidOfPageHasBeenChanged.next(view.viewName);
2258
- this.updateViewContext({
2258
+ await this.updateViewContext({
2259
2259
  updates: [
2260
2260
  {
2261
2261
  state: ViewState.Opened,
@@ -2265,7 +2265,7 @@ class SmartViewContextService {
2265
2265
  uuid: this.viewContext?.uuid,
2266
2266
  });
2267
2267
  }
2268
- closeView(view) {
2268
+ async closeView(view) {
2269
2269
  let viewHandler = this.viewHandlers.find((handler) => handler.name === view.viewName);
2270
2270
  if (!viewHandler) {
2271
2271
  throw new Error(`SmartViewHandlerModel was not found by view name: ${view.viewName}`);
@@ -2293,7 +2293,7 @@ class SmartViewContextService {
2293
2293
  this.openedViewUuids.splice(index, 1);
2294
2294
  this.openedViewData.splice(index, 1);
2295
2295
  sessionStorage.removeItem(view.viewName);
2296
- this.updateViewContext({
2296
+ await this.updateViewContext({
2297
2297
  updates: [
2298
2298
  {
2299
2299
  state: ViewState.Closed,
@@ -2311,26 +2311,24 @@ class SmartViewContextService {
2311
2311
  this.openView(view);
2312
2312
  });
2313
2313
  }
2314
- syncView() {
2315
- this.viewContext?.views.map((view) => {
2314
+ async syncView() {
2315
+ this.viewContext?.views.map(async (view) => {
2316
2316
  switch (view.state) {
2317
2317
  case ViewState.ToOpen:
2318
- this.openView(view);
2318
+ await this.openView(view);
2319
2319
  break;
2320
2320
  case ViewState.ToClose:
2321
- this.closeView(view);
2321
+ await this.closeView(view);
2322
2322
  break;
2323
2323
  }
2324
2324
  });
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
- }
2325
+ const viewDataToClose = this.openedViewData.filter((viewData) => !this.viewContext?.views
2326
+ .flatMap((viewData) => viewData.uuid)
2327
+ .includes(viewData.uuid));
2328
+ if (viewDataToClose?.length) {
2329
+ viewDataToClose.map(async (viewData) => {
2330
+ await this.closeView(viewData);
2331
+ });
2334
2332
  }
2335
2333
  this.viewContextHasBeenSynced.next();
2336
2334
  }