gbc-kyc-kit 3.0.19 → 3.0.20

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.
@@ -41136,7 +41136,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41136
41136
  const [similarity, setSimilarity] = useState(0);
41137
41137
  const [failLiveness, setFailLiveness] = useState(false);
41138
41138
  const [dataFailLiveness, setDataFailLiveness] = useState({});
41139
- const listener = async (event) => {
41139
+ const listener = (event) => {
41140
41140
  var _a, _b;
41141
41141
  if (event.detail) {
41142
41142
  if (event.detail.action === "PROCESS_FINISHED") {
@@ -41145,19 +41145,6 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41145
41145
  } else if (!failLiveness) {
41146
41146
  setFailLiveness(true);
41147
41147
  setDataFailLiveness(event);
41148
- } else {
41149
- await saveDataToDB({
41150
- data: {
41151
- selfie: "",
41152
- face_result_code: 0
41153
- },
41154
- component: "liveness",
41155
- eventId,
41156
- source: source2,
41157
- inProduction,
41158
- clientId,
41159
- geolocation
41160
- });
41161
41148
  }
41162
41149
  }
41163
41150
  }
@@ -41207,7 +41194,24 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41207
41194
  useEffect(() => {
41208
41195
  if (!lib$1(data2)) {
41209
41196
  onSendSubmitLiveness();
41210
- wrapAndSaveData();
41197
+ console.log("Entro al data no vacio");
41198
+ try {
41199
+ saveDataToDB({
41200
+ data: {
41201
+ selfie: `data:image/jpeg;base64,${data2.images[0]}`,
41202
+ similarity: faceMatch ? similarity : null,
41203
+ face_result_code: 0
41204
+ },
41205
+ component: "liveness",
41206
+ eventId,
41207
+ source: source2,
41208
+ inProduction,
41209
+ clientId,
41210
+ geolocation
41211
+ }).then((res) => dataLiveness(res));
41212
+ } catch (errorSavingData) {
41213
+ console.log(errorSavingData);
41214
+ }
41211
41215
  }
41212
41216
  }, [data2]);
41213
41217
  const onSendSubmitLiveness = async () => {
@@ -41268,28 +41272,6 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41268
41272
  Q.error("Error - Verificar host con el proveedor");
41269
41273
  }
41270
41274
  };
41271
- useEffect(() => {
41272
- similarity !== 0 && wrapAndSaveData();
41273
- }, [similarity]);
41274
- const wrapAndSaveData = async () => {
41275
- try {
41276
- await saveDataToDB({
41277
- data: {
41278
- selfie: `data:image/jpeg;base64,${data2.images[0]}`,
41279
- similarity: faceMatch ? similarity : null,
41280
- face_result_code: 0
41281
- },
41282
- component: "liveness",
41283
- eventId,
41284
- source: source2,
41285
- inProduction,
41286
- clientId,
41287
- geolocation
41288
- }).then((res) => dataLiveness(res));
41289
- } catch (errorSavingData) {
41290
- return errorSavingData;
41291
- }
41292
- };
41293
41275
  return {
41294
41276
  status,
41295
41277
  isLoading,