Closed kotasjan closed 8 months ago
Thanks, I will look into that ASAP.
I was able to reproduce issue #442 on a Pixel device with Android 14 (though on a Pixel device with Android 12, the camera does not stay active all the time).
I also tested your changes, and pausing the scanner does fix the issue - however it needs to be applied on other cases (e.g. when copy-pasting). A better solution is to simply use a
DisposableEffect
in theCameraPermissionsView.onPermissionGranted
callback, instead of aLaunchedEffect
:DisposableEffect(key1 = model) { if (model is Scan.Model.Ready && initialInput.isNullOrBlank()) scanView?.resume() onDispose { scanView?.pause() } }
If you give me push authorisation on your branch, I can update your PR with that change.
Thank you for the feedback. You are right with DisposableEffect
- it is a much cleaner solution. 👍 I have added you to contributors, so you should be able to push your changes now.
Please test the changes. I am quite confident these changes will work, but I didn't have a chance to build and run it due to hurdles with the project build setup. 😕