@credithub/harlan-components 1.61.5 → 1.62.0

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.
@@ -42,11 +42,13 @@ var CCF = function () {
42
42
  var ultimoRegistro = XPathUtils.select('string(//ultimo)', data) || '';
43
43
  return { ccfData: ccfData, totalOcorrencias: totalOcorrencias, ultimoRegistro: ultimoRegistro };
44
44
  }, [mapNodeToCCFData]);
45
- // Update global state when data changes
46
45
  useEffect(function () {
47
- if (ctx.type !== RequestStatus.Success || dataUpdated || !ctx.document) {
46
+ if (dataUpdated || !ctx.document) {
48
47
  return;
49
48
  }
49
+ if (ctx.type === RequestStatus.Error || ctx.type === RequestStatus.Empty) {
50
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { ccfData: { isLoaded: true } })); });
51
+ }
50
52
  var data = ctx.document;
51
53
  var _a = processData(data), ccfData = _a.ccfData, totalOcorrencias = _a.totalOcorrencias, ultimoRegistro = _a.ultimoRegistro;
52
54
  if (totalOcorrencias === 0) {
@@ -49,10 +49,13 @@ var DividasPublicas = function () {
49
49
  var setData = useGlobalData().setData;
50
50
  var _a = useState(false), dataUpdated = _a[0], setDataUpdated = _a[1];
51
51
  useEffect(function () {
52
- if (ctx.type !== RequestStatus.Success || dataUpdated || !ctx.document) {
52
+ if (dataUpdated || !ctx.document) {
53
53
  return;
54
54
  }
55
55
  var dividas = parseDividas(ctx.document);
56
+ if (ctx.type === RequestStatus.Error || ctx.type === RequestStatus.Empty) {
57
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { divida: { isLoaded: true } })); });
58
+ }
56
59
  if (!dataUpdated) {
57
60
  var dividasPublicas_1 = XPathUtils.select('number(//dividas/resumo/valor_total_dividas)', ctx.document) || 0;
58
61
  setData(function (prevState) { return (__assign(__assign({}, prevState), { divida: { dividas: dividas, isLoaded: true }, dividasPublicas: dividasPublicas_1 })); });
@@ -103,6 +103,7 @@ var Liminar = function () {
103
103
  });
104
104
  // Only log actual errors
105
105
  if (ctx.type === RequestStatus.Error && !isProcessoNaoEncontrado) {
106
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { liminar: { isLoaded: true } })); });
106
107
  console.error('Erro na requisição de liminares:', ctx.error || 'Erro desconhecido');
107
108
  }
108
109
  // Determine final status
@@ -48,9 +48,12 @@ var Protestos = function () {
48
48
  return 0;
49
49
  }, [ctxLiminar === null || ctxLiminar === void 0 ? void 0 : ctxLiminar.type]);
50
50
  useEffect(function () {
51
- if (ctx.type !== RequestStatus.Success || dataUpdated || !ctx.document) {
51
+ if (dataUpdated || !ctx.document) {
52
52
  return;
53
53
  }
54
+ if (ctx.type === RequestStatus.Error) {
55
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { protestosData: { isLoaded: true } })); });
56
+ }
54
57
  var data = ctx.document;
55
58
  var registrosText = XPathUtils.select('string(//registros)', data);
56
59
  var haveException = /Falha na integra/gi.test(XPathUtils.select('string(//raw)', data));