camera and gallery image crop
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { pushOverlayBack } from './platform.js';
|
||||
import type { ScanResult } from './scanner.js';
|
||||
import { Icon } from './ui.js';
|
||||
|
||||
@@ -10,6 +11,10 @@ export function ScannerView({ formats, hint, onResult, onClose }: { formats: For
|
||||
const [error, setError] = useState<string>();
|
||||
const onResultRef = useRef(onResult);
|
||||
onResultRef.current = onResult;
|
||||
// Android back button closes the scanner, not the screen underneath.
|
||||
const closeRef = useRef(onClose);
|
||||
closeRef.current = onClose;
|
||||
useEffect(() => pushOverlayBack(closeRef), []);
|
||||
|
||||
useEffect(() => {
|
||||
let stopped = false;
|
||||
|
||||
Reference in New Issue
Block a user