Skip to content

Commit

Permalink
Make sure camera is always set in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Jun 7, 2024
1 parent 859682c commit 4a3ce00
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ export default function Settings() {
);

useEffect(() => {
if (cameras.length) {
if (cameras.length > 0 && selectedCamera === "") {
setSelectedCamera(cameras[0].name);
}
// only run once
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [cameras, selectedCamera]);

useEffect(() => {
if (tabsRef.current) {
Expand Down

0 comments on commit 4a3ce00

Please sign in to comment.