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/cjs/index.js CHANGED
@@ -1132,12 +1132,13 @@ var useMetersValues = function (formStore, metersStore, shouldBeLoad, onLoad) {
1132
1132
  return [4 /*yield*/, metersStore.fetchMeters()];
1133
1133
  case 1:
1134
1134
  _c.sent();
1135
+ _c.label = 2;
1136
+ case 2:
1135
1137
  if (onLoad)
1136
1138
  onLoad();
1137
- _c.label = 2;
1138
- case 2: return [3 /*break*/, 4];
1139
+ return [3 /*break*/, 4];
1139
1140
  case 3:
1140
- if (onLoad)
1141
+ if (shouldBeLoad === false && onLoad)
1141
1142
  onLoad();
1142
1143
  _c.label = 4;
1143
1144
  case 4: return [2 /*return*/];
@@ -1146,7 +1147,7 @@ var useMetersValues = function (formStore, metersStore, shouldBeLoad, onLoad) {
1146
1147
  }); };
1147
1148
  react.useEffect(function () {
1148
1149
  loadMeters();
1149
- }, []);
1150
+ }, [shouldBeLoad]);
1150
1151
  react.useEffect(function () {
1151
1152
  if (!metersStore.loader.isLoading) {
1152
1153
  formStore.updateFormFields({ meters: metersStore.meters });
@@ -1195,17 +1196,18 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1195
1196
  return __generator(this, function (_c) {
1196
1197
  switch (_c.label) {
1197
1198
  case 0:
1198
- if (!shouldBeLoad) return [3 /*break*/, 3];
1199
- 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];
1199
+ if (!(shouldBeLoad && apartmentId)) return [3 /*break*/, 3];
1200
+ 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];
1200
1201
  return [4 /*yield*/, fillingStore.fetchFillingList(apartmentId, "appliance")];
1201
1202
  case 1:
1202
1203
  _c.sent();
1204
+ _c.label = 2;
1205
+ case 2:
1203
1206
  if (onLoad)
1204
1207
  onLoad();
1205
- _c.label = 2;
1206
- case 2: return [3 /*break*/, 4];
1208
+ return [3 /*break*/, 4];
1207
1209
  case 3:
1208
- if (onLoad)
1210
+ if (shouldBeLoad === false && onLoad)
1209
1211
  onLoad();
1210
1212
  _c.label = 4;
1211
1213
  case 4: return [2 /*return*/];
@@ -1214,7 +1216,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1214
1216
  }); };
1215
1217
  react.useEffect(function () {
1216
1218
  loadFillingList();
1217
- }, [apartmentId]);
1219
+ }, [apartmentId, shouldBeLoad]);
1218
1220
  react.useEffect(function () {
1219
1221
  var _a, _b;
1220
1222
  if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {