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(() => {
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) {