@jaak.ai/stamps 2.0.0-dev.39 → 2.0.0-dev.40

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.
@@ -1822,7 +1822,12 @@ const JaakStamps = class {
1822
1822
  }
1823
1823
  }
1824
1824
  resetDetection() {
1825
+ const currentCaptureState = this.stateManager.getCaptureState();
1826
+ const wasVideoActive = currentCaptureState.isVideoActive;
1825
1827
  this.stateManager.reset();
1828
+ if (wasVideoActive) {
1829
+ this.stateManager.updateCaptureState({ isVideoActive: true });
1830
+ }
1826
1831
  this.hasScreenshotTaken = false;
1827
1832
  this.startTime = Date.now();
1828
1833
  this.frameSkipCounter = 0;
@@ -1834,8 +1839,7 @@ const JaakStamps = class {
1834
1839
  clearTimeout(this.alignmentTimer);
1835
1840
  this.alignmentTimer = undefined;
1836
1841
  }
1837
- const captureState = this.stateManager.getCaptureState();
1838
- if (captureState.isVideoActive && this.detectionService.isModelLoaded()) {
1842
+ if (wasVideoActive && this.detectionService.isModelLoaded()) {
1839
1843
  this.updateStatus('Captura reiniciada', 'Buscando documento en el marco de captura', 'active');
1840
1844
  this.detectFrame();
1841
1845
  }
@@ -1849,6 +1853,7 @@ const JaakStamps = class {
1849
1853
  this.videoStream = undefined;
1850
1854
  this.stateManager.updateCaptureState({ isVideoActive: false, isLoading: false });
1851
1855
  }
1856
+ this.isMaskReady = false;
1852
1857
  this.updateStatus('Sesión finalizada', '', 'ready');
1853
1858
  this.detectionBoxes = [];
1854
1859
  this.cleanup();