Skip to content

Commit

Permalink
version: 0.2.6 - Camera mirror option/toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
richiemcilroy committed Jun 7, 2024
1 parent f75d249 commit 8329402
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/desktop/src/components/windows/Camera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const Camera = () => {
const [isLoading, setIsLoading] = useState(true);
const tauriWindowImport = import("@tauri-apps/api/window");
const [cameraMirrored, setCameraMirrored] = useState(
localStorage.getItem("cameraMirrored") || "false"
typeof window !== "undefined"
? localStorage.getItem("cameraMirrored") || "false"
: "false"
);

useEffect(() => {
Expand Down Expand Up @@ -55,7 +57,9 @@ export const Camera = () => {
video.style.transform =
newCameraMirrored === "true" ? "scaleX(-1)" : "scaleX(1)";
setCameraMirrored(newCameraMirrored);
localStorage.setItem("cameraMirrored", newCameraMirrored);
if (typeof window !== "undefined") {
localStorage.setItem("cameraMirrored", newCameraMirrored);
}
}
};

Expand Down

1 comment on commit 8329402

@vercel
Copy link

@vercel vercel bot commented on 8329402 Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.