Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanning the QR code will only emit to Flow when the QR code image is removed from the screen #8

Open
adamglin0 opened this issue Oct 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@adamglin0
Copy link
Contributor

No description provided.

@Caleb-Rainbow
Copy link

Android has the same problem

@adamglin0 adamglin0 changed the title Scanning the QR code will only emit to Flow when the QR code image is removed from the screen in IOS Scanning the QR code will only emit to Flow when the QR code image is removed from the screen Oct 14, 2024
@Caleb-Rainbow
Copy link

Caleb-Rainbow commented Oct 14, 2024

After checking, the problem is Flow.debounce(debounce)

qrScannerPlugin.getQrCodeFlow(debounce = 0)

In the example given, the debounce value is 500, which may cause the latest data to not be sent out in time because it is filtered out. Set it to 0, and now the QR code content can be obtained immediately.

@adamglin0
Copy link
Contributor Author

After checking, the problem is Flow.debounce(debounce)

qrScannerPlugin.getQrCodeFlow(debounce = 0)

In the example given, the debounce value is 500, which may cause the latest data to not be sent out in time because it is filtered out. Set it to 0, and now the QR code content can be obtained immediately.

Yes, if the QR code remains on the screen, the debounce will continue to be triggered until 500ms after the screen no longer recognizes the QR code.

It would be ideal to add distinctUntilChanged before debounce.

@Kashif-E
Copy link
Owner

@adamglin0 nice idea but this is a different issue on ios and flow issue is a different one. I guess rather then using flow it should be an atomic operation ill look into it more and then update the issue

@Kashif-E Kashif-E self-assigned this Oct 18, 2024
@Kashif-E Kashif-E added enhancement New feature or request bug Something isn't working labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants