react-native-rectangle-doc-scanner 3.87.0 → 3.88.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.87.0",
3
+ "version": "3.88.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -29,11 +29,9 @@
29
29
  [self start];
30
30
  _hasSetupCamera = YES;
31
31
  } else if (_hasSetupCamera && self.window && !CGRectIsEmpty(self.bounds)) {
32
- // Check if camera session is running, restart if needed
33
- if (self.captureSession && !self.captureSession.isRunning) {
34
- NSLog(@"[DocumentScanner] Camera session not running, restarting...");
35
- [self start];
36
- }
32
+ // Restart camera if needed (defensive check)
33
+ NSLog(@"[DocumentScanner] Layout update, ensuring camera is running");
34
+ [self start];
37
35
  }
38
36
  }
39
37
 
@@ -41,12 +39,10 @@
41
39
  [super didMoveToWindow];
42
40
  if (self.window && _hasSetupCamera) {
43
41
  // Restart camera when view is added back to window
44
- if (self.captureSession && !self.captureSession.isRunning) {
45
- NSLog(@"[DocumentScanner] View added to window, restarting camera...");
46
- dispatch_async(dispatch_get_main_queue(), ^{
47
- [self start];
48
- });
49
- }
42
+ NSLog(@"[DocumentScanner] View added to window, restarting camera...");
43
+ dispatch_async(dispatch_get_main_queue(), ^{
44
+ [self start];
45
+ });
50
46
  } else if (!self.window && _hasSetupCamera) {
51
47
  // Stop camera when view is removed from window
52
48
  NSLog(@"[DocumentScanner] View removed from window, stopping camera");