gbc-kyc-kit 3.0.21 → 3.0.22

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.
@@ -41152,6 +41152,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41152
41152
  useEffect(() => {
41153
41153
  var _a, _b, _c, _d;
41154
41154
  if (failLiveness) {
41155
+ console.log(inProduction, ":::::inProduction");
41155
41156
  saveDataToDB({
41156
41157
  data: {
41157
41158
  first_image: ((_b = (_a = dataFailLiveness.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.images) ? "data:image/jpeg;base64," + dataFailLiveness.detail.data.response.images[0] : null,
@@ -41171,6 +41172,8 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41171
41172
  setFailLiveness(false);
41172
41173
  setDataFailLiveness({});
41173
41174
  });
41175
+ } else {
41176
+ wrapAndSaveData();
41174
41177
  }
41175
41178
  }, [failLiveness]);
41176
41179
  useEffect(() => {
@@ -41194,7 +41197,6 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41194
41197
  useEffect(() => {
41195
41198
  if (!lib$1(data2)) {
41196
41199
  onSendSubmitLiveness();
41197
- console.log("Entro al data no vacio");
41198
41200
  }
41199
41201
  }, [data2]);
41200
41202
  const onSendSubmitLiveness = async () => {
@@ -41205,7 +41207,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41205
41207
  access_token: token2
41206
41208
  };
41207
41209
  try {
41208
- faceMatch && await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res) => {
41210
+ faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res) => {
41209
41211
  setSimilarity(res.data.similarity);
41210
41212
  setMessage(successMessage ? successMessage : "Verificaci\xF3n de identidad completada");
41211
41213
  saveDataToDB({
@@ -41222,20 +41224,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41222
41224
  clientId,
41223
41225
  geolocation
41224
41226
  });
41225
- });
41226
- saveDataToDB({
41227
- data: {
41228
- selfie: `data:image/jpeg;base64,${data2.images[0]}`,
41229
- similarity: null,
41230
- face_result_code: 0
41231
- },
41232
- component: "liveness",
41233
- eventId,
41234
- source: source2,
41235
- inProduction,
41236
- clientId,
41237
- geolocation
41238
- }).then((res) => dataLiveness(res));
41227
+ }) : wrapAndSaveData();
41239
41228
  } catch (error) {
41240
41229
  let message2 = "";
41241
41230
  const {
@@ -41268,6 +41257,28 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
41268
41257
  Q.error("Error - Verificar host con el proveedor");
41269
41258
  }
41270
41259
  };
41260
+ useEffect(() => {
41261
+ similarity !== 0 && wrapAndSaveData();
41262
+ }, [similarity]);
41263
+ const wrapAndSaveData = async () => {
41264
+ try {
41265
+ await saveDataToDB({
41266
+ data: {
41267
+ selfie: `data:image/jpeg;base64,${data2.images[0]}`,
41268
+ similarity: faceMatch ? similarity : null,
41269
+ face_result_code: 0
41270
+ },
41271
+ component: "liveness",
41272
+ eventId,
41273
+ source: source2,
41274
+ inProduction,
41275
+ clientId,
41276
+ geolocation
41277
+ }).then((res) => dataLiveness(res));
41278
+ } catch (errorSavingData) {
41279
+ return errorSavingData;
41280
+ }
41281
+ };
41271
41282
  return {
41272
41283
  status,
41273
41284
  isLoading,