Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

version: Release 0.2.9 - Scap recording engine integration

Richie McIlroy510126ec7193
diff --git a/apps/desktop/src/components/windows/Camera.tsx b/apps/desktop/src/components/windows/Camera.tsx
index aae5a91f0..5fba6f6ed 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]
);