diff --git a/apps/desktop/src/components/windows/Camera.tsx b/apps/desktop/src/components/windows/Camera.tsx index aae5a91f..5fba6f6e 100644 --- a/apps/desktop/src/components/windows/Camera.tsx +++ b/apps/desktop/src/components/windows/Camera.tsx @@ -22,12 +22,16 @@ export const Camera = () => { ); const [overlaySize, setOverlaySize] = useState<"sm" | "lg">("sm"); const [overlayShape, setOverlayShape] = useState<"round" | "square">( - (localStorage.getItem("cameraOverlayShape") as "round" | "square") || - "round" + typeof localStorage !== "undefined" + ? (localStorage.getItem("cameraOverlayShape") as "round" | "square") || + "round" + : "round" ); useEffect( - () => localStorage.setItem("cameraOverlayShape", overlayShape), + () => + typeof localStorage !== "undefined" && + localStorage.setItem("cameraOverlayShape", overlayShape), [overlayShape] );