@smartbit4all/ng-client 3.3.186 → 3.3.187

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.
@@ -2951,11 +2951,18 @@ class SmartViewContextService {
2951
2951
  uuid: view.uuid,
2952
2952
  };
2953
2953
  }
2954
- updateContext(updates) {
2955
- this.updateViewContext({
2956
- updates,
2957
- uuid: this.viewContext?.uuid,
2954
+ sendViewContextUpdates(updatesToSend) {
2955
+ const updates = [];
2956
+ updatesToSend.forEach((update) => {
2957
+ if (update !== undefined && update !== null)
2958
+ updates.push(update);
2958
2959
  });
2960
+ if (updates.length > 0) {
2961
+ this.updateViewContext({
2962
+ updates,
2963
+ uuid: this.viewContext?.uuid,
2964
+ });
2965
+ }
2959
2966
  }
2960
2967
  async restoreViews(uuid) {
2961
2968
  const updates = [];
@@ -2968,25 +2975,19 @@ class SmartViewContextService {
2968
2975
  updates.push(update);
2969
2976
  }
2970
2977
  });
2971
- if (updates.length > 0) {
2972
- this.updateContext(updates);
2973
- }
2978
+ this.sendViewContextUpdates(updates);
2974
2979
  }
2975
2980
  syncView() {
2976
2981
  const updates = [];
2977
2982
  this.viewContext?.views.map((view) => {
2978
- let update = undefined;
2979
2983
  switch (view.state) {
2980
2984
  case ViewState.TO_OPEN:
2981
- update = this.openView(view);
2985
+ updates.push(this.openView(view));
2982
2986
  break;
2983
2987
  case ViewState.TO_CLOSE:
2984
- update = this.closeView(view);
2988
+ updates.push(this.closeView(view));
2985
2989
  break;
2986
2990
  }
2987
- if (update) {
2988
- updates.push(update);
2989
- }
2990
2991
  });
2991
2992
  const viewDataToClose = this.openedViewData.filter((viewData) => !this.viewContext?.views
2992
2993
  .flatMap((viewData) => viewData.uuid)
@@ -2996,7 +2997,7 @@ class SmartViewContextService {
2996
2997
  updates.push(this.closeView(viewData));
2997
2998
  });
2998
2999
  }
2999
- this.updateContext(updates);
3000
+ this.sendViewContextUpdates(updates);
3000
3001
  this.viewContext?.links?.map((data) => {
3001
3002
  const link = document.createElement('a');
3002
3003
  let target = '_blank'; // default