mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: access document on client 2
This commit is contained in:
1 parent
9818c9868a
commit
886c2aa1d1
2 files changed
+2
-4
No files matched your search
@@ -183,9 +183,7 @@ export function Options({ isFullScreen }: OptionsProps) {
|
||||
onClick={() => {
|
||||
if (isFullScreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (typeof document !== 'undefined') {
|
||||
document.body.requestFullscreen();
|
||||
}
|
||||
} else document.body.requestFullscreen();
|
||||
}}
|
||||
>
|
||||
{isFullScreen ? <ExitFullScreenIcon /> : <EnterFullScreenIcon />}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
|
||||
export function useFullScreen() {
|
||||
const [isFullScreen, setIsFullScreen] = useState(
|
||||
document.fullscreenElement !== null,
|
||||
typeof document !== 'undefined' && document.fullscreenElement !== null,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user