We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 845aff8 commit 510126eCopy full SHA for 510126e
apps/desktop/src/components/windows/Camera.tsx
@@ -22,12 +22,16 @@ export const Camera = () => {
22
);
23
const [overlaySize, setOverlaySize] = useState<"sm" | "lg">("sm");
24
const [overlayShape, setOverlayShape] = useState<"round" | "square">(
25
- (localStorage.getItem("cameraOverlayShape") as "round" | "square") ||
26
- "round"
+ typeof localStorage !== "undefined"
+ ? (localStorage.getItem("cameraOverlayShape") as "round" | "square") ||
27
+ "round"
28
+ : "round"
29
30
31
useEffect(
- () => localStorage.setItem("cameraOverlayShape", overlayShape),
32
+ () =>
33
+ typeof localStorage !== "undefined" &&
34
+ localStorage.setItem("cameraOverlayShape", overlayShape),
35
[overlayShape]
36
37
0 commit comments