@credithub/harlan-components 1.62.1 → 1.62.2

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.
@@ -48,6 +48,7 @@ var CCF = function () {
48
48
  }
49
49
  if (ctx.type === RequestStatus.Error || ctx.type === RequestStatus.Empty) {
50
50
  setData(function (prevState) { return (__assign(__assign({}, prevState), { ccfData: { isLoaded: true } })); });
51
+ return;
51
52
  }
52
53
  var data = ctx.document;
53
54
  var _a = processData(data), ccfData = _a.ccfData, totalOcorrencias = _a.totalOcorrencias, ultimoRegistro = _a.ultimoRegistro;
@@ -55,6 +55,7 @@ var DividasPublicas = function () {
55
55
  var dividas = parseDividas(ctx.document);
56
56
  if (ctx.type === RequestStatus.Error || ctx.type === RequestStatus.Empty) {
57
57
  setData(function (prevState) { return (__assign(__assign({}, prevState), { divida: { isLoaded: true } })); });
58
+ return;
58
59
  }
59
60
  if (!dataUpdated) {
60
61
  var dividasPublicas_1 = XPathUtils.select('number(//dividas/resumo/valor_total_dividas)', ctx.document) || 0;
@@ -23,12 +23,6 @@ var ProcessosJuridicos = function (_a) {
23
23
  // Use a ref instead of state to track whether data has been processed
24
24
  var processedRef = useRef(false);
25
25
  var ctxHashRef = useRef('');
26
- useEffect(function () {
27
- if (ctx.type === RequestStatus.Loading) {
28
- processedRef.current = false;
29
- setData(function (prevState) { return (__assign(__assign({}, prevState), { processosJuridicosData: __assign(__assign({}, prevState.processosJuridicosData), { isLoaded: false }) })); });
30
- }
31
- }, [ctx.type, setData]);
32
26
  useEffect(function () {
33
27
  var _a;
34
28
  // Create a hash of the current context state to detect changes
@@ -89,8 +83,9 @@ var ProcessosJuridicos = function (_a) {
89
83
  useEffect(function () {
90
84
  if (ctx.type === RequestStatus.Loading) {
91
85
  processedRef.current = false;
86
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { processosJuridicosData: __assign(__assign({}, prevState.processosJuridicosData), { isLoaded: false }) })); });
92
87
  }
93
- }, [ctx.type]);
88
+ }, [ctx.type, setData]);
94
89
  return (React.createElement(Section, { ctx: ctx, title: "Processos Jur\u00EDdicos", subtitle: "Veja os processos jur\u00EDdicos para este documento.", icon: ProcessosJuridicosIcon, minimized: false, onSuccess: function (data) {
95
90
  var _a;
96
91
  var qtyProcessos = (_a = data.empresa) === null || _a === void 0 ? void 0 : _a.length;
@@ -51,8 +51,9 @@ var Protestos = function () {
51
51
  if (dataUpdated || !ctx.document) {
52
52
  return;
53
53
  }
54
- if (ctx.type === RequestStatus.Error) {
54
+ if (ctx.type === RequestStatus.Error || ctx.type === RequestStatus.Empty) {
55
55
  setData(function (prevState) { return (__assign(__assign({}, prevState), { protestosData: { isLoaded: true } })); });
56
+ return;
56
57
  }
57
58
  var data = ctx.document;
58
59
  var registrosText = XPathUtils.select('string(//registros)', data);