Make sure camera is always set in settings (#11812)

This commit is contained in:
Josh Hawkins 2024-06-07 14:34:29 -05:00 committed by GitHub
parent 859682c8d1
commit e1bedf30bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,12 +81,10 @@ export default function Settings() {
); );
useEffect(() => { useEffect(() => {
if (cameras.length) { if (cameras.length > 0 && selectedCamera === "") {
setSelectedCamera(cameras[0].name); setSelectedCamera(cameras[0].name);
} }
// only run once }, [cameras, selectedCamera]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => { useEffect(() => {
if (tabsRef.current) { if (tabsRef.current) {