idmission-web-sdk 1.0.324 → 1.0.325

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.
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
50
50
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.324';
53
+ var webSdkVersion = '1.0.325';
54
54
 
55
55
  function getPlatform() {
56
56
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9378,6 +9378,7 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
9378
9378
  modelDownloadProgress = _m[0],
9379
9379
  setModelDownloadProgress = _m[1];
9380
9380
  React.useEffect(function () {
9381
+ var _a;
9381
9382
  setReady(false);
9382
9383
  function handleDownloadProgress(event) {
9383
9384
  setModelDownloadProgress(progressToPercentage(event.detail));
@@ -9422,12 +9423,18 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
9422
9423
  function handleWebglContextLoss() {
9423
9424
  setModelError(new Error('WebGL context was lost.'));
9424
9425
  }
9425
- var webGLCanvas = getWebGLContext(2).canvas;
9426
- webGLCanvas.addEventListener('webglcontextlost', handleWebglContextLoss);
9426
+ var webGLCanvas = (_a = getWebGLContext(2)) === null || _a === void 0 ? void 0 : _a.canvas;
9427
+ if (webGLCanvas) {
9428
+ webGLCanvas.addEventListener('webglcontextlost', handleWebglContextLoss);
9429
+ } else {
9430
+ handleWebglContextLoss();
9431
+ }
9427
9432
  return function () {
9428
9433
  var _a;
9429
9434
  clearInterval(modelLoadTimeout);
9430
- (_a = webGLCanvas.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(webGLCanvas, 'webglcontextlost', handleWebglContextLoss);
9435
+ if (webGLCanvas) {
9436
+ (_a = webGLCanvas.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(webGLCanvas, 'webglcontextlost', handleWebglContextLoss);
9437
+ }
9431
9438
  document.removeEventListener('idmission.preloadProgress.idCapture', handleDownloadProgress);
9432
9439
  };
9433
9440
  }, [documentDetectionModelUrl, focusModelUrl, modelLoadTimeoutMs]);