- Fix stale closure bug in camera capture loop (scanning state
captured as false, preventing any frame capture)
- Add GIF File input mode to receiver — upload a QR-over-GIF
directly to test the decode pipeline without camera
- Update decode worker to accept imageData or frameData
- Receiver now shows two input modes: Camera and GIF File
The rAF capture loop checked where
was a state variable captured in a stale closure.
The loop was created when scanning=false, so it immediately
exited on every frame and never captured any camera frames.
Fix: use scanningRef (useRef) instead of state for the loop
guard, so the rAF callback always reads the live value.