Skip to content

Commit

Permalink
ensure window is not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski committed Sep 25, 2024
1 parent b9e44d5 commit 59ad745
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ export function Root({
}, TRANSITIONS.DURATION * 1000);

if (o && !modal) {
requestAnimationFrame(() => {
document.body.style.pointerEvents = 'auto';
});
if (typeof window !== 'undefined') {
window.requestAnimationFrame(() => {
document.body.style.pointerEvents = 'auto';
});
}
}

if (!o) {
Expand Down

0 comments on commit 59ad745

Please sign in to comment.