Skip to content

Conversation

@csuich2
Copy link

@csuich2 csuich2 commented Nov 15, 2025

Proposed change

Leverage the usePersistence() hook to store the selected camera so that navigating away from the settings page and back will remember the selected camera.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

Additional information

  • This PR fixes or closes issue: n/a
  • This PR is related to issue: n/a

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • [n/a] UI changes including text have used i18n keys and have been added to the en locale.
  • [prettier] The code has been formatted using Ruff (ruff format frigate)

@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit 793906b
🔍 Latest deploy log https://app.netlify.com/projects/frigate-docs/deploys/6918a8a81a12ad0008ea772c
😎 Deploy Preview https://deploy-preview-20932--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Leverage the usePersistence() hook to store the selected camera so that
navigating away from the settings page and back will remember the
selected camera.
@hawkeye217
Copy link
Collaborator

This won't work correctly without changes. usePersistence can return undefined while the value is loading from local storage, so this will cause type errors on the other functions that use selectedCamera.

@NickM-27
Copy link
Collaborator

I'm also unsure why this needs to change

@csuich2
Copy link
Author

csuich2 commented Nov 16, 2025

This won't work correctly without changes. usePersistence can return undefined while the value is loading from local storage, so this will cause type errors on the other functions that use selectedCamera.

Interesting. I played around but didn't encounter this. I'll take a look.

I'm also unsure why this needs to change

Just kinda personal preference, I suppose. So I understand if you don't want this change. When tweaking settings and jumping on/off the settings page I found myself tired of having to switch back to the camera I was iterating on and would have preferred if it remembered the camera.

@csuich2
Copy link
Author

csuich2 commented Nov 16, 2025

I should have included in the description that my gut was to use a query param to store the selected camera, but I found the persistence that was used elsewhere. I'd be happy to look into that approach if you are interested in the functionality but don't want to use persistence. That would also avoid the issue while loading from local storage.

@hawkeye217
Copy link
Collaborator

Query parameters will introduce an additional layer of complexity as a number of features already pass in parameters that can override the selected camera.

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

Successfully merging this pull request may close these issues.

3 participants