@credithub/harlan-components 1.83.0 → 1.83.1
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.
|
@@ -184,8 +184,9 @@ var Liminar = function (_a) {
|
|
|
184
184
|
(_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
|
|
185
185
|
]), origensDetectadas = _w.origensDetectadas, foundBusinessEntity = _w.foundBusinessEntity;
|
|
186
186
|
var documentHistoryReady = useMemo(function () { return isDocumentHistoryReady(globalData); }, [globalData]);
|
|
187
|
+
var protestosIsReady = useMemo(function () { var _a; return (_a = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _a === void 0 ? void 0 : _a.isLoaded; }, [globalData]);
|
|
187
188
|
useEffect(function () {
|
|
188
|
-
if (!documentHistoryReady)
|
|
189
|
+
if (!documentHistoryReady || !protestosIsReady)
|
|
189
190
|
return;
|
|
190
191
|
var fetch = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
191
192
|
var dossie, processosJuridicos, depsLoaded, newIds, hash, indiciosApi, indiciosDeLiminarProtestosDoPassado, protestosDoPassadoIds, _a, possuiIndiciosDeLiminarProtestosDoPassado, protestosIds, finalStatus, descricaoLiminar;
|
|
@@ -38,6 +38,7 @@ import XPathUtils from '../../utils/xpath';
|
|
|
38
38
|
import { Client } from '@credithub/webservice';
|
|
39
39
|
import { useCallback, useContext } from 'react';
|
|
40
40
|
import { WebService } from '../webservice';
|
|
41
|
+
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
41
42
|
/**
|
|
42
43
|
* Hook que identifica indícios de liminar de sustação de protesto.
|
|
43
44
|
*
|
|
@@ -51,6 +52,7 @@ import { WebService } from '../webservice';
|
|
|
51
52
|
var useLiminarProtestosDoPassado = function (_a) {
|
|
52
53
|
var documento = _a.documento;
|
|
53
54
|
var client = useContext(WebService);
|
|
55
|
+
var globalData = useGlobalData().data;
|
|
54
56
|
/** Máximo de requisições simultâneas ao endpoint de PDF. */
|
|
55
57
|
var MAX_CONCURRENT = 10;
|
|
56
58
|
/** Timeout (ms) por requisição individual ao PDF. */
|
|
@@ -97,7 +99,7 @@ var useLiminarProtestosDoPassado = function (_a) {
|
|
|
97
99
|
case 2:
|
|
98
100
|
parsed = (_a.sent());
|
|
99
101
|
nodes = XPathUtils.selectArray('//protesto/nm_chave', parsed);
|
|
100
|
-
numerosChave = Array.from(new Set(nodes.map(function (n) { return n.textContent || ''; })));
|
|
102
|
+
numerosChave = Array.from(new Set(nodes.map(function (n) { return n.textContent || ''; }))).filter(function (e) { var _a; return !(((_a = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _a === void 0 ? void 0 : _a.nmChaves) || []).includes(e); });
|
|
101
103
|
ocultos = [];
|
|
102
104
|
idx = 0;
|
|
103
105
|
running = [];
|