We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 126790b commit 0438450Copy full SHA for 0438450
src/core/utils.ts
@@ -90,9 +90,10 @@ export function deepIncludes(a: any, b: any): boolean {
90
}
91
92
export function isDocumentVisible(): boolean {
93
- const visibilityState = document?.visibilityState as any
94
-
95
- return [undefined, 'visible', 'prerender'].includes(visibilityState)
+ if (typeof document === 'undefined') {
+ return true
+ }
96
+ return [undefined, 'visible', 'prerender'].includes(document.visibilityState)
97
98
99
export function isOnline(): boolean {
0 commit comments