oxedom / parker

Parking detection and monitoring webapp that runs entirely in the browser
https://parker-oxedoms-projects.vercel.app/
MIT License
137 stars 13 forks source link

Prevent Auto detecting from rerunning when minimizing tab #4

Closed oxedom closed 1 year ago

oxedom commented 1 year ago

Problem

Auto detecting state is set to true when tab is closed.

Solution

Something likely to do with the lifecycle and a useEffect side effect setting the state to true.

oxedom commented 1 year ago

To ensure the demo video element onPlay ClientRender does not refire when minimized for a while, I have made a cleaner bug fix by adding an if statement to check if the number of selected regions of interest (rois) is greater than 0. If the condition is met, the function will set auto detect to true.