File tree Expand file tree Collapse file tree
apps/desktop/src/components/windows Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ export const Camera = () => {
1313 const [ isLoading , setIsLoading ] = useState ( true ) ;
1414 const tauriWindowImport = import ( "@tauri-apps/api/window" ) ;
1515 const [ cameraMirrored , setCameraMirrored ] = useState (
16- localStorage . getItem ( "cameraMirrored" ) || "false"
16+ typeof window !== "undefined"
17+ ? localStorage . getItem ( "cameraMirrored" ) || "false"
18+ : "false"
1719 ) ;
1820
1921 useEffect ( ( ) => {
@@ -55,7 +57,9 @@ export const Camera = () => {
5557 video . style . transform =
5658 newCameraMirrored === "true" ? "scaleX(-1)" : "scaleX(1)" ;
5759 setCameraMirrored ( newCameraMirrored ) ;
58- localStorage . setItem ( "cameraMirrored" , newCameraMirrored ) ;
60+ if ( typeof window !== "undefined" ) {
61+ localStorage . setItem ( "cameraMirrored" , newCameraMirrored ) ;
62+ }
5963 }
6064 } ;
6165
You can’t perform that action at this time.
0 commit comments