aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/hooks')
-rw-r--r--apps/web/src/hooks/useViewport.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/web/src/hooks/useViewport.ts b/apps/web/src/hooks/useViewport.ts
index ca4ec741..f24ed2d2 100644
--- a/apps/web/src/hooks/useViewport.ts
+++ b/apps/web/src/hooks/useViewport.ts
@@ -1,7 +1,10 @@
import { useState, useEffect } from "react";
function getViewport() {
- const { innerWidth: width, innerHeight: height } = window;
+ const { innerWidth: width, innerHeight: height } = window ?? {
+ innerWidth: 0,
+ innerHeight: 0,
+ };
return {
width,
height,