react-native-rectangle-doc-scanner 3.50.0 → 3.51.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.
@@ -120,8 +120,14 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
120
120
  path: document.path,
121
121
  croppedPath: document.croppedPath,
122
122
  initialPath: document.initialPath,
123
+ captureMode: captureModeRef.current,
123
124
  });
124
125
  const captureMode = captureModeRef.current;
126
+ // Ignore auto captures - only process manual captures
127
+ if (!captureMode) {
128
+ console.log('[FullDocScanner] Ignoring auto capture - only manual captures allowed');
129
+ return;
130
+ }
125
131
  captureModeRef.current = null;
126
132
  const normalizedDoc = normalizeCapturedDocument(document);
127
133
  if (captureMode === 'no-grid') {
@@ -144,16 +150,22 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
144
150
  processing,
145
151
  hasRef: !!docScannerRef.current,
146
152
  rectangleDetected,
153
+ currentCaptureMode: captureModeRef.current,
147
154
  });
148
155
  if (processing) {
149
156
  console.log('[FullDocScanner] Already processing, skipping manual capture');
150
157
  return;
151
158
  }
159
+ // Check if capture is already in progress
160
+ if (captureModeRef.current !== null) {
161
+ console.log('[FullDocScanner] Capture already in progress, skipping');
162
+ return;
163
+ }
152
164
  if (!docScannerRef.current) {
153
165
  console.error('[FullDocScanner] DocScanner ref not available');
154
166
  return;
155
167
  }
156
- console.log('[FullDocScanner] Starting manual capture');
168
+ console.log('[FullDocScanner] Starting manual capture, grid detected:', rectangleDetected);
157
169
  captureModeRef.current = rectangleDetected ? 'grid' : 'no-grid';
158
170
  docScannerRef.current.capture()
159
171
  .then((result) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.50.0",
3
+ "version": "3.51.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -163,9 +163,17 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
163
163
  path: document.path,
164
164
  croppedPath: document.croppedPath,
165
165
  initialPath: document.initialPath,
166
+ captureMode: captureModeRef.current,
166
167
  });
167
168
 
168
169
  const captureMode = captureModeRef.current;
170
+
171
+ // Ignore auto captures - only process manual captures
172
+ if (!captureMode) {
173
+ console.log('[FullDocScanner] Ignoring auto capture - only manual captures allowed');
174
+ return;
175
+ }
176
+
169
177
  captureModeRef.current = null;
170
178
 
171
179
  const normalizedDoc = normalizeCapturedDocument(document);
@@ -195,6 +203,7 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
195
203
  processing,
196
204
  hasRef: !!docScannerRef.current,
197
205
  rectangleDetected,
206
+ currentCaptureMode: captureModeRef.current,
198
207
  });
199
208
 
200
209
  if (processing) {
@@ -202,12 +211,18 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
202
211
  return;
203
212
  }
204
213
 
214
+ // Check if capture is already in progress
215
+ if (captureModeRef.current !== null) {
216
+ console.log('[FullDocScanner] Capture already in progress, skipping');
217
+ return;
218
+ }
219
+
205
220
  if (!docScannerRef.current) {
206
221
  console.error('[FullDocScanner] DocScanner ref not available');
207
222
  return;
208
223
  }
209
224
 
210
- console.log('[FullDocScanner] Starting manual capture');
225
+ console.log('[FullDocScanner] Starting manual capture, grid detected:', rectangleDetected);
211
226
 
212
227
  captureModeRef.current = rectangleDetected ? 'grid' : 'no-grid';
213
228