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

Camera is still open after unmounting or switching route #2

Open
Jervx opened this issue Feb 22, 2024 · 1 comment
Open

Camera is still open after unmounting or switching route #2

Jervx opened this issue Feb 22, 2024 · 1 comment

Comments

@Jervx
Copy link
Contributor

Jervx commented Feb 22, 2024

Camera is still open after route has changed and the page & component unmounts. I'm seeing my camera light indicator still on.

im using Qr Code Reader on the register page route /events/[id]/register where user can scan their qrcode ID number
image

once I changed the route like go back to /event/[id] which is the landing page of the specific event. And the camera was still on, and it is also indicated at the tab of the browser
image
image

Im using Next.js 14

@isneverdead
Copy link

Camera is still open after route has changed and the page & component unmounts. I'm seeing my camera light indicator still on.

im using Qr Code Reader on the register page route /events/[id]/register where user can scan their qrcode ID number image

once I changed the route like go back to /event/[id] which is the landing page of the specific event. And the camera was still on, and it is also indicated at the tab of the browser image image

Im using Next.js 14

I also have this kind of problem before two years ago, and still everyone have struggle with it, but here is my solution, i know this is not the best but since i'm using Next 14, reloading the page is not a big deal for me, it feels seamless tho. you can use this to reload the page, so it will close the scanner component window.location.reload();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants