Skip to content

Commit 9bc28aa

Browse files
committed
DBC22-1302: fixed cams defaulting to null
1 parent 3938d89 commit 9bc28aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/frontend/src/Components/map/camPopup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ export default function CamPopup(props) {
2222
const isInitialMount = useRef(true);
2323

2424
// useState hooks
25-
const [rootCam, setRootCam] = useState();
26-
const [camera, setCamera] = useState();
25+
const newCam = camFeature.id ? camFeature : camFeature.getProperties();
26+
const [rootCam, setRootCam] = useState(newCam);
27+
const [camera, setCamera] = useState(newCam);
2728
const [camIndex, setCamIndex] = useState(0);
2829

2930
// useEffect hooks

0 commit comments

Comments
 (0)