coer-elements 0.0.52 → 0.0.54

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.
@@ -797,19 +797,27 @@ class Filters {
797
797
  static Get(path) {
798
798
  let storage = sessionStorage.getItem(this.storage);
799
799
  storage = JSON.parse(storage);
800
- return (Tools.IsNotNull(storage?.filters))
801
- ? storage.filters.find((x) => x.some((y) => y === path))[1] || null
802
- : null;
800
+ if (Tools.IsNotNull(storage?.filters)) {
801
+ for (const filterList of storage.filters) {
802
+ if (filterList.some((x) => x === path)) {
803
+ return filterList[1];
804
+ }
805
+ }
806
+ }
807
+ return null;
803
808
  }
804
809
  /** */
805
810
  static Remove(path) {
806
811
  let storage = sessionStorage.getItem(this.storage);
807
812
  storage = JSON.parse(storage);
808
813
  if (Tools.IsNotNull(storage?.filters)) {
809
- const index = storage.filters.findIndex((x) => x.some((y) => y === path));
810
- if (index >= 0) {
811
- storage.filters.splice(index, 1);
814
+ let index = 0;
815
+ for (index; index < storage.filters.length; index++) {
816
+ if (storage.filters[index].some((x) => x === path)) {
817
+ break;
818
+ }
812
819
  }
820
+ storage.filters.splice(index, 1);
813
821
  }
814
822
  sessionStorage.setItem(this.storage, JSON.stringify(storage));
815
823
  }
@@ -1051,6 +1059,7 @@ class Page {
1051
1059
  if (this._source) {
1052
1060
  Breadcrumbs.RemoveLast();
1053
1061
  this.SetPageResponse(pageResponse);
1062
+ this.RemovePageFilter();
1054
1063
  Tools.Sleep().then(_ => this.router.navigateByUrl(this._source.path));
1055
1064
  }
1056
1065
  }
@@ -1078,6 +1087,11 @@ class Page {
1078
1087
  this.pageFilters = Filters.Get(this._path);
1079
1088
  }
1080
1089
  /** */
1090
+ RemovePageFilter() {
1091
+ this.pageFilters = {};
1092
+ Filters.Remove(this._path);
1093
+ }
1094
+ /** */
1081
1095
  Log(value, log = null) {
1082
1096
  if (Tools.IsNotNull(log))
1083
1097
  console.log({ log, value });