Skip to content

Commit e1bedf3

Browse files
authored
Make sure camera is always set in settings (#11812)
1 parent 859682c commit e1bedf3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

web/src/pages/Settings.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,10 @@ export default function Settings() {
8181
);
8282

8383
useEffect(() => {
84-
if (cameras.length) {
84+
if (cameras.length > 0 && selectedCamera === "") {
8585
setSelectedCamera(cameras[0].name);
8686
}
87-
// only run once
88-
// eslint-disable-next-line react-hooks/exhaustive-deps
89-
}, []);
87+
}, [cameras, selectedCamera]);
9088

9189
useEffect(() => {
9290
if (tabsRef.current) {

0 commit comments

Comments
 (0)