@credithub/harlan-components 1.82.2 → 1.82.4

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.
@@ -49,6 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  import ProtestosIcon from '../../assets/icones/protestos';
50
50
  import { useGlobalData } from '../../contexts/globalDataContext';
51
51
  import theme from '../../styles/theme';
52
+ import { isDocumentHistoryReady } from '../../utils/isGlobalReady';
52
53
  import { formatMoney } from '../../utils/number';
53
54
  import { normalizeName, normalizeNameStrong, similarCompanyNames } from '../../utils/similarNames';
54
55
  import { hasOneOfTags } from '../../utils/tags';
@@ -121,7 +122,6 @@ var Liminar = function (_a) {
121
122
  var carouselName = (_c = (_b = (_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '';
122
123
  var empresas = (_d = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _d === void 0 ? void 0 : _d.empresa;
123
124
  var nomeNormTokens = normalizeNameStrong(carouselName);
124
- console.log('nomeNormTokens', nomeNormTokens);
125
125
  if (!Array.isArray(empresas))
126
126
  return [];
127
127
  return empresas.filter(function (proc) {
@@ -143,7 +143,6 @@ var Liminar = function (_a) {
143
143
  (_d = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _d === void 0 ? void 0 : _d.carousel,
144
144
  (_e = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _e === void 0 ? void 0 : _e.empresa
145
145
  ]);
146
- console.log('processosComAssuntoValido', processosComAssuntoValido);
147
146
  /*
148
147
  * Identifica as origens de liminares detectadas e verifica se existe liminar de protesto invertida
149
148
  */
@@ -184,7 +183,10 @@ var Liminar = function (_a) {
184
183
  processosComAssuntoValido,
185
184
  (_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
186
185
  ]), origensDetectadas = _w.origensDetectadas, foundBusinessEntity = _w.foundBusinessEntity;
186
+ var documentHistoryReady = useMemo(function () { return isDocumentHistoryReady(globalData); }, [globalData]);
187
187
  useEffect(function () {
188
+ if (!documentHistoryReady)
189
+ return;
188
190
  var fetch = function () { return __awaiter(void 0, void 0, void 0, function () {
189
191
  var dossie, processosJuridicos, depsLoaded, newIds, hash, indiciosApi, indiciosDeLiminarProtestosDoPassado, protestosDoPassadoIds, _a, possuiIndiciosDeLiminarProtestosDoPassado, protestosIds, finalStatus, descricaoLiminar;
190
192
  var _b, _c, _d;
@@ -211,9 +213,7 @@ var Liminar = function (_a) {
211
213
  indiciosApi = ((_c = ctx.document) === null || _c === void 0 ? void 0 : _c.indiciosDeLiminar) === true;
212
214
  indiciosDeLiminarProtestosDoPassado = false;
213
215
  protestosDoPassadoIds = '';
214
- if (!(!indiciosApi &&
215
- !processosComAssuntoValido.length &&
216
- ((_d = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _d === void 0 ? void 0 : _d.protestoLiminar))) return [3 /*break*/, 2];
216
+ if (!((_d = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _d === void 0 ? void 0 : _d.protestoLiminar)) return [3 /*break*/, 2];
217
217
  setIsLoadingLiminarProtestosDoPassado(true);
218
218
  return [4 /*yield*/, fetchLiminarProtestosDoPassado()];
219
219
  case 1:
@@ -262,6 +262,7 @@ var Liminar = function (_a) {
262
262
  ctx.document,
263
263
  globalData === null || globalData === void 0 ? void 0 : globalData.dossie,
264
264
  globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData,
265
+ globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory,
265
266
  processosComAssuntoValido,
266
267
  setData,
267
268
  foundBusinessEntity
@@ -106,7 +106,7 @@ var useLiminarProtestosDoPassado = function (_a) {
106
106
  switch (_a.label) {
107
107
  case 0: return [4 /*yield*/, possuiPdf(chave)];
108
108
  case 1:
109
- if (!(_a.sent()))
109
+ if (_a.sent())
110
110
  ocultos.push(chave);
111
111
  return [2 /*return*/];
112
112
  }
@@ -1,3 +1,4 @@
1
1
  import { GlobalState } from '@/types/globalState.d';
2
2
  export declare const isGlobalReady: (g: GlobalState) => boolean | undefined;
3
3
  export declare const areModulesLoaded: (g: GlobalState) => boolean | undefined;
4
+ export declare const isDocumentHistoryReady: (g: GlobalState) => boolean;
@@ -14,3 +14,4 @@ export var areModulesLoaded = function (g) {
14
14
  ((_c = g.ccfData) === null || _c === void 0 ? void 0 : _c.isLoaded) &&
15
15
  ((_d = g.divida) === null || _d === void 0 ? void 0 : _d.isLoaded);
16
16
  };
17
+ export var isDocumentHistoryReady = function (g) { return !!g.documentHistory; };