@credithub/harlan-components 1.100.0 → 1.100.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.
- package/dist/components/liminar/useLiminarHistory.js +21 -8
- package/lib/cjs/index.js +22 -9
- package/lib/esm/index.js +22 -9
- package/package.json +1 -1
|
@@ -16,10 +16,12 @@ export function useLiminarHistory(_a) {
|
|
|
16
16
|
useEffect(function () {
|
|
17
17
|
if (!enabled || !documento)
|
|
18
18
|
return;
|
|
19
|
-
|
|
19
|
+
// Deriva o boolean do conteúdo de types para evitar falsos positivos
|
|
20
|
+
var effectiveTypes = Array.isArray(types) && indicioDeLiminar ? types : [];
|
|
21
|
+
var safeIndicio = effectiveTypes.length > 0;
|
|
20
22
|
var fingerprint = JSON.stringify({
|
|
21
23
|
documento: documento,
|
|
22
|
-
indicioDeLiminar:
|
|
24
|
+
indicioDeLiminar: safeIndicio,
|
|
23
25
|
types: __spreadArray([], effectiveTypes, true).sort(),
|
|
24
26
|
protestKeys: protestKeys,
|
|
25
27
|
processIds: processIds
|
|
@@ -28,13 +30,24 @@ export function useLiminarHistory(_a) {
|
|
|
28
30
|
return;
|
|
29
31
|
var payload = {
|
|
30
32
|
documento: documento,
|
|
31
|
-
indicioDeLiminar:
|
|
32
|
-
types: JSON.stringify(effectiveTypes)
|
|
33
|
+
indicioDeLiminar: safeIndicio ? 'true' : 'false'
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Serializa arrays como campos indexados (types[0], types[1], ...)
|
|
36
|
+
if (safeIndicio && effectiveTypes.length) {
|
|
37
|
+
effectiveTypes.forEach(function (t, i) {
|
|
38
|
+
payload["types[".concat(i, "]")] = t;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (protestKeys.length) {
|
|
42
|
+
protestKeys.forEach(function (k, i) {
|
|
43
|
+
payload["protestKeys[".concat(i, "]")] = k;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (processIds.length) {
|
|
47
|
+
processIds.forEach(function (p, i) {
|
|
48
|
+
payload["processIds[".concat(i, "]")] = p;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
38
51
|
insertHistory(payload);
|
|
39
52
|
lastFingerprint.current = fingerprint;
|
|
40
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|