kui-crm_actions 0.0.124 → 0.0.126

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.
package/index.d.ts CHANGED
@@ -971,7 +971,7 @@ type InspectionFeedbackProps = {
971
971
 
972
972
  declare const _default: (props: InspectionFeedbackProps) => JSX.Element | null;
973
973
 
974
- declare const useMetersValues: (formStore: MultistepForm<any>, metersStore: ApartmentMetersStoreInterface, shouldBeLoad: boolean, onLoad?: (() => void) | undefined) => void;
974
+ declare const useMetersValues: (formStore: MultistepForm<any>, metersStore: ApartmentMetersStoreInterface, shouldBeLoad?: boolean | undefined, onLoad?: (() => void) | undefined) => void;
975
975
 
976
976
  declare class FillingListStore {
977
977
  fillingList: FillingCheckParams[];
@@ -981,7 +981,7 @@ declare class FillingListStore {
981
981
  updateFillingList: (fillingList: FillingListItemModel[]) => void;
982
982
  }
983
983
 
984
- declare const useFillingList: (apartmentId: number | null, formStore: MultistepForm<any>, fillingStore: FillingListStore, shouldBeLoad: boolean, onLoad?: (() => void) | undefined) => void;
984
+ declare const useFillingList: (apartmentId: number | null, formStore: MultistepForm<any>, fillingStore: FillingListStore, shouldBeLoad?: boolean | undefined, onLoad?: (() => void) | undefined) => void;
985
985
 
986
986
  type AddedMetersBlockProps = {
987
987
  formStore: MultistepForm<any>
package/index.js CHANGED
@@ -1103,12 +1103,13 @@ var useMetersValues = function (formStore, metersStore, shouldBeLoad, onLoad) {
1103
1103
  return [4 /*yield*/, metersStore.fetchMeters()];
1104
1104
  case 1:
1105
1105
  _c.sent();
1106
+ _c.label = 2;
1107
+ case 2:
1106
1108
  if (onLoad)
1107
1109
  onLoad();
1108
- _c.label = 2;
1109
- case 2: return [3 /*break*/, 4];
1110
+ return [3 /*break*/, 4];
1110
1111
  case 3:
1111
- if (onLoad)
1112
+ if (shouldBeLoad === false && onLoad)
1112
1113
  onLoad();
1113
1114
  _c.label = 4;
1114
1115
  case 4: return [2 /*return*/];
@@ -1117,7 +1118,7 @@ var useMetersValues = function (formStore, metersStore, shouldBeLoad, onLoad) {
1117
1118
  }); };
1118
1119
  useEffect(function () {
1119
1120
  loadMeters();
1120
- }, []);
1121
+ }, [shouldBeLoad]);
1121
1122
  useEffect(function () {
1122
1123
  if (!metersStore.loader.isLoading) {
1123
1124
  formStore.updateFormFields({ meters: metersStore.meters });
@@ -1166,17 +1167,18 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1166
1167
  return __generator(this, function (_c) {
1167
1168
  switch (_c.label) {
1168
1169
  case 0:
1169
- if (!shouldBeLoad) return [3 /*break*/, 3];
1170
- if (!(!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length) && apartmentId)) return [3 /*break*/, 2];
1170
+ if (!(shouldBeLoad && apartmentId)) return [3 /*break*/, 3];
1171
+ if (!!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) return [3 /*break*/, 2];
1171
1172
  return [4 /*yield*/, fillingStore.fetchFillingList(apartmentId, "appliance")];
1172
1173
  case 1:
1173
1174
  _c.sent();
1175
+ _c.label = 2;
1176
+ case 2:
1174
1177
  if (onLoad)
1175
1178
  onLoad();
1176
- _c.label = 2;
1177
- case 2: return [3 /*break*/, 4];
1179
+ return [3 /*break*/, 4];
1178
1180
  case 3:
1179
- if (onLoad)
1181
+ if (shouldBeLoad === false && onLoad)
1180
1182
  onLoad();
1181
1183
  _c.label = 4;
1182
1184
  case 4: return [2 /*return*/];
@@ -1185,7 +1187,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1185
1187
  }); };
1186
1188
  useEffect(function () {
1187
1189
  loadFillingList();
1188
- }, [apartmentId]);
1190
+ }, [apartmentId, shouldBeLoad]);
1189
1191
  useEffect(function () {
1190
1192
  var _a, _b;
1191
1193
  if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {